From 2bea97e24e3113df2d25c6e5cd10940f5459b08d Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 28 Feb 2017 12:33:14 +0000 Subject: [PATCH] Small extra deletion safeguard in ComponentAnimator --- modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp b/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp index 7393f25766..4da854b66b 100644 --- a/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp +++ b/modules/juce_gui_basics/layout/juce_ComponentAnimator.cpp @@ -131,11 +131,13 @@ public: { if (component != nullptr) { + const WeakReference weakRef (this); component->setAlpha ((float) destAlpha); component->setBounds (destination); - if (proxy != nullptr) - component->setVisible (destAlpha > 0); + if (! weakRef.wasObjectDeleted()) + if (proxy != nullptr) + component->setVisible (destAlpha > 0); } }