VST3: Release plugin factory before unloading plugin
This commit is contained in:
@@ -1099,7 +1099,6 @@ VST3PI::VST3PI (boost::shared_ptr<ARDOUR::VST3PluginModule> m, int index, std::s
|
||||
|
||||
VST3PI::~VST3PI ()
|
||||
{
|
||||
_processor = 0;
|
||||
terminate ();
|
||||
}
|
||||
|
||||
@@ -1128,6 +1127,10 @@ VST3PI::unit_data ()
|
||||
void
|
||||
VST3PI::terminate ()
|
||||
{
|
||||
deactivate ();
|
||||
|
||||
_processor = 0;
|
||||
|
||||
disconnect_components ();
|
||||
|
||||
bool controller_is_component = false;
|
||||
@@ -1136,9 +1139,18 @@ VST3PI::terminate ()
|
||||
_component->terminate ();
|
||||
}
|
||||
|
||||
if (_controller) {
|
||||
_controller->setComponentHandler (0);
|
||||
}
|
||||
|
||||
if (_controller && controller_is_component == false) {
|
||||
_controller->terminate ();
|
||||
}
|
||||
|
||||
if (_factory) {
|
||||
_factory->release ();
|
||||
}
|
||||
|
||||
_component = 0;
|
||||
_controller = 0;
|
||||
}
|
||||
|
||||
@@ -159,7 +159,6 @@ ARDOUR::discover_vst3 (boost::shared_ptr<VST3PluginModule> m, std::vector<VST3In
|
||||
FUnknownPtr<Vst::IAudioProcessor> processor;
|
||||
if (!(processor = FUnknownPtr<Vst::IAudioProcessor> (component))) {
|
||||
cerr << "VST3: No valid processor";
|
||||
//controller->terminate();
|
||||
component->terminate ();
|
||||
continue;
|
||||
}
|
||||
@@ -177,11 +176,16 @@ ARDOUR::discover_vst3 (boost::shared_ptr<VST3PluginModule> m, std::vector<VST3In
|
||||
nfo.n_midi_inputs = count_channels (component, Vst::kEvent, Vst::kInput, Vst::kMain);
|
||||
nfo.n_midi_outputs = count_channels (component, Vst::kEvent, Vst::kOutput, Vst::kMain);
|
||||
|
||||
processor->setProcessing (false);
|
||||
component->setActive (false);
|
||||
|
||||
//controller->terminate();
|
||||
component->terminate ();
|
||||
rv.push_back (nfo);
|
||||
}
|
||||
}
|
||||
|
||||
factory->release ();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user