1
0
Fork 0
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:
reuk 2025-02-06 09:39:51 +00:00
parent 95d416ab77
commit 70652e3d23
No known key found for this signature in database
3 changed files with 2 additions and 22 deletions

View file

@ -2621,7 +2621,7 @@ public:
~VST3PluginInstance() override
{
callOnMessageThread ([this] { cleanup(); });
MessageManager::callSync ([this] { cleanup(); });
}
void cleanup()

View file

@ -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()

View file

@ -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
//==============================================================================