13
0

Fix VST3 processor refcount

This fixes an issue with JUCE plugins remaining alive
after closing the session (and causing issues at exit).
see also 789949ed8e
This commit is contained in:
Robin Gareus 2022-03-20 15:37:51 +01:00
parent 0aabdc0849
commit 6bcc0163cd
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 3 additions and 6 deletions

View File

@ -237,8 +237,8 @@ private:
Linux::IRunLoop* _run_loop;
#endif
FUnknownPtr<Vst::IAudioProcessor> _processor;
Vst::ProcessContext _context;
IPtr<Vst::IAudioProcessor> _processor;
Vst::ProcessContext _context;
/* Parameters */
Vst3ParameterChanges _input_param_changes;

View File

@ -1103,7 +1103,7 @@ VST3PI::VST3PI (boost::shared_ptr<ARDOUR::VST3PluginModule> m, std::string uniqu
throw failed_constructor ();
}
if (!(_processor = FUnknownPtr<Vst::IAudioProcessor> (_component).take ())) {
if (!(_processor = FUnknownPtr<Vst::IAudioProcessor> (_component))) {
_controller->terminate ();
_controller->release ();
_component->terminate ();
@ -1111,8 +1111,6 @@ VST3PI::VST3PI (boost::shared_ptr<ARDOUR::VST3PluginModule> m, std::string uniqu
throw failed_constructor ();
}
_processor->addRef ();
/* prepare process context */
memset (&_context, 0, sizeof (Vst::ProcessContext));
@ -1242,7 +1240,6 @@ VST3PI::terminate ()
deactivate ();
_processor->release ();
_processor = 0;
disconnect_components ();