13
0

Unload VST3 modules when closing session

This is perhaps a better solution than b8551eed7e
and 8d0a655608 and 7942897d93. It is certainly less
fragile.

It is more consistent with other plugin standards,
where modules are closed with the last instance in a session.

Then again keeping the VST3 factory around is beneficial
when switching snapshots.

Discuss, and let's watch for issues when re-loading a
previously unloaded VST3 module.
This commit is contained in:
Robin Gareus 2023-10-27 04:43:44 +02:00
parent b8551eed7e
commit cd5369c7cd
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04

View File

@ -134,6 +134,7 @@
#include "ardour/utils.h" #include "ardour/utils.h"
#include "ardour/vca_manager.h" #include "ardour/vca_manager.h"
#include "ardour/vca.h" #include "ardour/vca.h"
#include "ardour/vst3_plugin.h"
#include "midi++/port.h" #include "midi++/port.h"
#include "midi++/mmc.h" #include "midi++/mmc.h"
@ -864,6 +865,11 @@ Session::destroy ()
_transport_fsm->stop (); _transport_fsm->stop ();
/* close VST3 Modules */
for (auto const& nfo : PluginManager::instance().vst3_plugin_info()) {
std::dynamic_pointer_cast<VST3PluginInfo> (nfo)->m.reset ();
}
DEBUG_TRACE (DEBUG::Destruction, "Session::destroy() done\n"); DEBUG_TRACE (DEBUG::Destruction, "Session::destroy() done\n");
#ifndef NDEBUG #ifndef NDEBUG