1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-16 00:34:19 +00:00

Avoiding crashes in plugins if components get deleted during a paint callback

This commit is contained in:
jules 2014-05-16 09:09:44 +01:00
parent 0e158e3630
commit cc3aa5c757
3 changed files with 6 additions and 3 deletions

View file

@ -1051,7 +1051,8 @@ public:
Timer::callPendingTimersSynchronously();
for (int i = ComponentPeer::getNumPeers(); --i >= 0;)
ComponentPeer::getPeer (i)->performAnyPendingRepaintsNow();
if (ComponentPeer* p = ComponentPeer::getPeer(i))
p->performAnyPendingRepaintsNow();
recursionCheck = false;
}

View file

@ -1655,7 +1655,6 @@ public:
if (isControllerInitialised) editController->terminate();
if (isComponentInitialised) component->terminate();
//Deletion order appears to matter:
componentConnection = nullptr;
editControllerConnection = nullptr;
unitData = nullptr;
@ -1667,6 +1666,8 @@ public:
editController2 = nullptr;
editController = nullptr;
component = nullptr;
host = nullptr;
module = nullptr;
}
bool initialise()

View file

@ -1285,7 +1285,8 @@ public:
handleUpdateNowIfNeeded();
for (int i = ComponentPeer::getNumPeers(); --i >= 0;)
ComponentPeer::getPeer(i)->performAnyPendingRepaintsNow();
if (ComponentPeer* p = ComponentPeer::getPeer(i))
p->performAnyPendingRepaintsNow();
}
break;