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)
This commit is contained in:
Robin Gareus 2020-11-25 05:33:16 +01:00
parent 3a74c5e602
commit 7942897d93
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 6 additions and 0 deletions

View File

@ -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(),

View File

@ -1223,6 +1223,7 @@ Mixer_UI::set_session (Session* sess)
_group_tabs->set_session (sess);
if (!_session) {
favorite_plugins_model->clear ();
_selection.clear ();
return;
}