From 4c2c0874daec9a607448cbf3df0d83e0f2081222 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 24 Apr 2020 17:04:38 +0100 Subject: [PATCH] VST: Fixed a potential crash when resizing host window asynchronously --- .../format_types/juce_VSTPluginFormat.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp index f9780dd027..f312fd0d4d 100644 --- a/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp +++ b/modules/juce_audio_processors/format_types/juce_VSTPluginFormat.cpp @@ -2943,7 +2943,13 @@ public: setScaleFactorAndDispatchMessage (peer->getPlatformScaleFactor()); #if JUCE_LINUX - MessageManager::callAsync ([this] { componentMovedOrResized (true, true); }); + SafePointer safeThis (this); + + MessageManager::callAsync ([this, safeThis] + { + if (safeThis != nullptr) + componentMovedOrResized (true, true); + }); #else componentMovedOrResized (true, true); #endif