From e3c310961808bbf81566e5ebb41d32952dff984b Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 1 Mar 2021 22:11:15 +0100 Subject: [PATCH] Unsubscribe from signals when clearing references This fixes crashes with plugins calling setDirty() when the UI is closed. `plugin` has already been reset before the actual window is closed: `PluginUIWindow::~PluginUIWindow()` runs, and destroys the window, here `~VST3NSViewPluginUI ()`. This closes the VST3 view, which triggers a `VST3PI::setDirty`. At this point in time `~PlugUIBase()` has not yet run, so all signals are still connected. setDirty() ends up calling PlugUIBase::update_preset_modified() which access `plugin` pointer, which is NULL. --- gtk2_ardour/plugin_ui.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index 45081c93b2..65b1e82cdc 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -636,6 +636,7 @@ PlugUIBase::~PlugUIBase() void PlugUIBase::plugin_going_away () { + drop_connections (); /* drop references to the plugin/insert */ insert.reset (); plugin.reset ();