From 5c03d13f0dfcb06b19a77f37bd9c82a4022ea411 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 14 Dec 2018 12:13:39 +0000 Subject: [PATCH] Revert previous commit and instead call ComponentHelpers::releaseAllCachedImageResources() from Component::removeFromDesktop() --- modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp | 1 - modules/juce_gui_basics/components/juce_Component.cpp | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-) 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 0bf6ed0611..a3375a1b24 100644 --- a/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp +++ b/modules/juce_audio_plugin_client/VST3/juce_VST3_Wrapper.cpp @@ -874,7 +874,6 @@ private: if (component != nullptr) { #if JUCE_WINDOWS - component->setVisible (false); component->removeFromDesktop(); #else if (macHostWindow != nullptr) diff --git a/modules/juce_gui_basics/components/juce_Component.cpp b/modules/juce_gui_basics/components/juce_Component.cpp index d7eb8e8bea..a8d52d9cc9 100644 --- a/modules/juce_gui_basics/components/juce_Component.cpp +++ b/modules/juce_gui_basics/components/juce_Component.cpp @@ -700,6 +700,8 @@ void Component::removeFromDesktop() if (flags.hasHeavyweightPeerFlag) { + ComponentHelpers::releaseAllCachedImageResources (*this); + auto* peer = ComponentPeer::getPeerFor (this); jassert (peer != nullptr);