mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
AudioProcessor: Use new MessageManager::callSync
This commit is contained in:
parent
95d416ab77
commit
70652e3d23
3 changed files with 2 additions and 22 deletions
|
|
@ -2621,7 +2621,7 @@ public:
|
|||
|
||||
~VST3PluginInstance() override
|
||||
{
|
||||
callOnMessageThread ([this] { cleanup(); });
|
||||
MessageManager::callSync ([this] { cleanup(); });
|
||||
}
|
||||
|
||||
void cleanup()
|
||||
|
|
|
|||
|
|
@ -1117,7 +1117,7 @@ struct VSTPluginInstance final : public AudioPluginInstance,
|
|||
~VSTPluginInstance() override
|
||||
{
|
||||
if (vstEffect != nullptr && vstEffect->magic == 0x56737450 /* 'VstP' */)
|
||||
callOnMessageThread ([this] { cleanup(); });
|
||||
MessageManager::callSync ([this] { cleanup(); });
|
||||
}
|
||||
|
||||
void cleanup()
|
||||
|
|
|
|||
|
|
@ -86,26 +86,6 @@ static bool arrayContainsPlugin (const OwnedArray<PluginDescription>& list,
|
|||
|
||||
#endif
|
||||
|
||||
template <typename Callback>
|
||||
void callOnMessageThread (Callback&& callback)
|
||||
{
|
||||
if (MessageManager::getInstance()->existsAndIsLockedByCurrentThread())
|
||||
{
|
||||
callback();
|
||||
return;
|
||||
}
|
||||
|
||||
WaitableEvent completionEvent;
|
||||
|
||||
MessageManager::callAsync ([&callback, &completionEvent]
|
||||
{
|
||||
callback();
|
||||
completionEvent.signal();
|
||||
});
|
||||
|
||||
completionEvent.wait();
|
||||
}
|
||||
|
||||
#if JUCE_MAC
|
||||
|
||||
//==============================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue