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:
parent
0e158e3630
commit
cc3aa5c757
3 changed files with 6 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue