mirror of
https://github.com/juce-framework/JUCE.git
synced 2026-01-09 23:34:20 +00:00
MPEKeyboardComponent: Catch potential 'use after free' when cleaning up
This commit is contained in:
parent
59bb818f09
commit
9bddeb9324
1 changed files with 5 additions and 1 deletions
|
|
@ -507,7 +507,11 @@ void MPEKeyboardComponent::noteReleased (MPENote finishedNote)
|
|||
|
||||
void MPEKeyboardComponent::zoneLayoutChanged()
|
||||
{
|
||||
MessageManager::callAsync ([this] { updateZoneLayout(); });
|
||||
MessageManager::callAsync ([ref = SafePointer<MPEKeyboardComponent> { this }]
|
||||
{
|
||||
if (ref != nullptr)
|
||||
ref->updateZoneLayout();
|
||||
});
|
||||
}
|
||||
|
||||
} // namespace juce
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue