Properly unload VST3 plugins

The InstrumentSelector keeps a PluginPtr reference to all
instruments. By default Ardour does not destroy the editor
at exit, So 3 instances of Instrument Selector can remain

 * TriggerClipPicker in the editor sidebar (owned by _editor)
 * TriggerClipPicker on the TriggerPage (owned by trigger_page)
 * SoundFileOmega (sfbrowser owned by Editor)

If a shared_ptr reference is retained, VST3 Module is not
unloaded at exit. This leads to issues with various plugins.
eg. Reason Rack does not terminate, Ardour hangs at exit.
This commit is contained in:
Robin Gareus 2023-10-27 00:39:03 +02:00
parent 49124ab987
commit b8551eed7e
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
3 changed files with 17 additions and 0 deletions

View file

@ -146,6 +146,7 @@
#include "gui_object.h"
#include "gui_thread.h"
#include "idleometer.h"
#include "instrument_selector.h"
#include "io_plugin_window.h"
#include "keyboard.h"
#include "keyeditor.h"
@ -868,6 +869,8 @@ ARDOUR_UI::~ARDOUR_UI ()
recorder->cleanup ();
}
InstrumentSelector::DropPluginInfoPtr ();
if (getenv ("ARDOUR_RUNNING_UNDER_VALGRIND")) {
// don't bother at 'real' exit. the OS cleans up for us.
delete big_clock; big_clock = 0;