BR: Crash in MPEKeyboardComponent

When running pluginval --strictness-level 10 --verbose --validate on a vst3 plugin that contains a MPEKeyboardComponent, a crash occurs on line 510 of juce_MPEKeyboardComponent.cpp in MPEKeyboardComponent::zoneLayoutChanged()

This seems to be because this line of code fails to check if the component still exists:

    MessageManager::callAsync ([this] { updateZoneLayout(); });

I’ve temporarily fixed it locally with the following change:

    MessageManager::callAsync ([this, weakThis = SafePointer<MPEKeyboardComponent>(this)] { if(weakThis) updateZoneLayout(); });
2 Likes

Thanks for the suggestion, I will get it in.

1 Like