From 170aae70566003a30ab1f6f936364484f6a0a097 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 1 Jun 2011 16:20:49 +0300 Subject: Clean variables after deleting. --- src/guichan/widgets/imagebutton.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/guichan/widgets/imagebutton.cpp') diff --git a/src/guichan/widgets/imagebutton.cpp b/src/guichan/widgets/imagebutton.cpp index a340face3..141b17b79 100644 --- a/src/guichan/widgets/imagebutton.cpp +++ b/src/guichan/widgets/imagebutton.cpp @@ -81,13 +81,19 @@ namespace gcn ImageButton::~ImageButton() { if (mInternalImage) + { delete mImage; + mImage = 0; + } } void ImageButton::setImage(const Image* image) { if (mInternalImage) + { delete mImage; + mImage = 0; + } mImage = image; mInternalImage = false; -- cgit v1.2.3-70-g09d2