Skip to content

Commit 718bc5b

Browse files
JWBverheesenmtytel
authored andcommitted
destroy app_ instance on guiDestroy
Tested with Reaper on linux, guiDestroy is invoked when closing the UI, or the parent window the plugin is displayed in. This generates a x11 bad window error: X11 Error: 3 To resolve, reset the unique_ptr app_ by assigning nullptr to it. clap/gui.h states that all resources associated with the gui should be freed.
1 parent 968d780 commit 718bc5b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

examples/ClapPlugin/clap_plugin.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ void ClapPlugin::guiDestroy() noexcept {
9797
#endif
9898

9999
app_->close();
100+
101+
#if __linux__
102+
app_ = nullptr;
103+
#endif
100104
}
101105

102106
bool ClapPlugin::guiSetParent(const clap_window* window) noexcept {

0 commit comments

Comments
 (0)