From fd01869cfd042d6cc17aeae0f8d5d10716e7c4d7 Mon Sep 17 00:00:00 2001 From: reuk Date: Wed, 12 Jun 2024 19:04:34 +0100 Subject: [PATCH] AU Client: Avoid creating ModalComponentManager during shutdown The ScopedJuceInitialiser may have been destroyed before shutdown is called, in which case singletons will have been deleted and cleared. Attempting to access the ModalComponentManager here will recreate it, and will trigger a leak detector warning later on. --- .../juce_audio_plugin_client/juce_audio_plugin_client_AU_1.mm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_1.mm b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_1.mm index b1c77944c2..93967ab583 100644 --- a/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_1.mm +++ b/modules/juce_audio_plugin_client/juce_audio_plugin_client_AU_1.mm @@ -1843,7 +1843,8 @@ public: { // there's some kind of component currently modal, but the host // is trying to delete our plugin.. - jassert (Component::getCurrentlyModalComponent() == nullptr); + jassert (ModalComponentManager::getInstanceWithoutCreating() == nullptr + || Component::getCurrentlyModalComponent() == nullptr); } } };