summaryrefslogtreecommitdiff
path: root/src/guichan/widgets/imagebutton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/guichan/widgets/imagebutton.cpp')
-rw-r--r--src/guichan/widgets/imagebutton.cpp6
1 files changed, 6 insertions, 0 deletions
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;