diff --git a/modules/juce_audio_utils/gui/juce_MPEKeyboardComponent.cpp b/modules/juce_audio_utils/gui/juce_MPEKeyboardComponent.cpp index 0685c4d564..104a27e432 100644 --- a/modules/juce_audio_utils/gui/juce_MPEKeyboardComponent.cpp +++ b/modules/juce_audio_utils/gui/juce_MPEKeyboardComponent.cpp @@ -507,7 +507,11 @@ void MPEKeyboardComponent::noteReleased (MPENote finishedNote) void MPEKeyboardComponent::zoneLayoutChanged() { - MessageManager::callAsync ([this] { updateZoneLayout(); }); + MessageManager::callAsync ([ref = SafePointer { this }] + { + if (ref != nullptr) + ref->updateZoneLayout(); + }); } } // namespace juce