From 7942897d931369d87802598053e2f0dd47e677c7 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 25 Nov 2020 05:33:16 +0100 Subject: [PATCH] VST3: cleanup, drop references (1/2) VST3PluginInfo holds a shared_ptr reference to VST3PluginModule. In order to cleanly unload a plugin, all references have to be dropped. Unloading a plugin cleanly before exit is needed in some cases (e.g. Waves shell otherwise crashes) --- gtk2_ardour/ardour_ui.cc | 5 +++++ gtk2_ardour/mixer_ui.cc | 1 + 2 files changed, 6 insertions(+) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 09c45532e3..9397c5106f 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -209,6 +209,7 @@ typedef uint64_t microseconds_t; #include "virtual_keyboard_window.h" #include "add_video_dialog.h" #include "transcode_video_dialog.h" +#include "plugin_selector.h" #include "pbd/i18n.h" @@ -851,8 +852,12 @@ ARDOUR_UI::~ARDOUR_UI () delete main_window_visibility; FastMeter::flush_pattern_cache (); ArdourFader::flush_pattern_cache (); + } else if (mixer) { + /* drop references to any PluginInfoPtr */ + delete mixer->plugin_selector (); } + #ifndef NDEBUG /* Small trick to flush main-thread event pool. * Other thread-pools are destroyed at pthread_exit(), diff --git a/gtk2_ardour/mixer_ui.cc b/gtk2_ardour/mixer_ui.cc index 21d3d84171..1b49d398fb 100644 --- a/gtk2_ardour/mixer_ui.cc +++ b/gtk2_ardour/mixer_ui.cc @@ -1223,6 +1223,7 @@ Mixer_UI::set_session (Session* sess) _group_tabs->set_session (sess); if (!_session) { + favorite_plugins_model->clear (); _selection.clear (); return; }