mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-10 23:44:24 +00:00
VST3 Client: Fix issue where active run loops could be removed incorrectly
The same run loop may be registered multiple times, e.g. if the host passes the same run loop pointer to multiple instances of the plugin. When a particular run loop client goes out of scope, it should only remove its own reference to the run loop, because other clients may still be active and still using that run loop.
This commit is contained in:
parent
6cc8827174
commit
695a51832b
1 changed files with 9 additions and 1 deletions
|
|
@ -214,7 +214,15 @@ public:
|
|||
void unregisterHandlerForFrame (IPlugFrame* plugFrame)
|
||||
{
|
||||
if (auto* runLoop = getRunLoopFromFrame (plugFrame))
|
||||
refreshAttachedEventLoop ([this, runLoop] { hostRunLoops.erase (runLoop); });
|
||||
{
|
||||
refreshAttachedEventLoop ([this, runLoop]
|
||||
{
|
||||
const auto it = hostRunLoops.find (runLoop);
|
||||
|
||||
if (it != hostRunLoops.end())
|
||||
hostRunLoops.erase (it);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/* Asserts if it can be established that the calling thread is different from the host's message
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue