From 90b6f62318c3ce827ab67d7d8678b0ec74633a6a Mon Sep 17 00:00:00 2001 From: jules Date: Tue, 9 Jun 2015 08:23:26 -0700 Subject: [PATCH] Avoided a dangling pointer problem when changing images in DrawableButton --- modules/juce_gui_basics/buttons/juce_DrawableButton.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/juce_gui_basics/buttons/juce_DrawableButton.cpp b/modules/juce_gui_basics/buttons/juce_DrawableButton.cpp index 83e9c893f4..f944bec703 100644 --- a/modules/juce_gui_basics/buttons/juce_DrawableButton.cpp +++ b/modules/juce_gui_basics/buttons/juce_DrawableButton.cpp @@ -59,6 +59,7 @@ void DrawableButton::setImages (const Drawable* normal, overImageOn = copyDrawableIfNotNull (overOn); downImageOn = copyDrawableIfNotNull (downOn); disabledImageOn = copyDrawableIfNotNull (disabledOn); + currentImage = nullptr; buttonStateChanged(); }