Skip to content

Commit

Permalink
Add crash safeguards against incorrect VST3 calling sequences
Browse files Browse the repository at this point in the history
  • Loading branch information
David Schornsheim committed Feb 26, 2024
1 parent 1500382 commit e283df5
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/wrapasvst3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,10 @@ tresult PLUGIN_API ClapAsVst3::terminate()
if (_plugin)
{
_os_attached.off(); // ensure we are detached
if (_active)
{
_plugin->deactivate();
}
_plugin->terminate();
_plugin.reset();
}
Expand Down Expand Up @@ -111,6 +115,11 @@ tresult PLUGIN_API ClapAsVst3::setActive(TBool state)

tresult PLUGIN_API ClapAsVst3::process(Vst::ProcessData& data)
{
if (!_active || !_processing)
{
return kNotInitialized;
}

auto thisFn = _plugin->AlwaysAudioThread();
this->_processAdapter->process(data);
return kResultOk;
Expand Down

0 comments on commit e283df5

Please sign in to comment.