From 3bca5221ff902ea3fd61422eee4e3849df20bfe9 Mon Sep 17 00:00:00 2001 From: ed Date: Tue, 28 Apr 2020 16:48:35 +0100 Subject: [PATCH] VST3: Check if plugFrame is still valid in Linux fd callback to fix issue with hosts deleting plugFrame before calling removed() --- .../juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp index 7f5632b850..266c65acb7 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -1050,10 +1050,13 @@ private: #if JUCE_LINUX void PLUGIN_API onFDIsSet (Steinberg::Linux::FileDescriptor fd) override { - auto it = fdCallbackMap.find (fd); + if (plugFrame != nullptr) + { + auto it = fdCallbackMap.find (fd); - if (it != fdCallbackMap.end()) - it->second (fd); + if (it != fdCallbackMap.end()) + it->second (fd); + } } #endif