summaryrefslogtreecommitdiff
path: root/src/guichan/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2011-06-01 16:20:49 +0300
committerAndrei Karas <akaras@inbox.ru>2011-06-01 16:20:49 +0300
commit170aae70566003a30ab1f6f936364484f6a0a097 (patch)
tree44002a7f43d1fdd8ba8253e729da825bd82142c3 /src/guichan/widgets
parent09ebcebf32be3842d6158c3145492fbf2959440e (diff)
downloadmv-170aae70566003a30ab1f6f936364484f6a0a097.tar.gz
mv-170aae70566003a30ab1f6f936364484f6a0a097.tar.bz2
mv-170aae70566003a30ab1f6f936364484f6a0a097.tar.xz
mv-170aae70566003a30ab1f6f936364484f6a0a097.zip
Clean variables after deleting.
Diffstat (limited to 'src/guichan/widgets')
-rw-r--r--src/guichan/widgets/dropdown.cpp6
-rw-r--r--src/guichan/widgets/icon.cpp3
-rw-r--r--src/guichan/widgets/imagebutton.cpp6
-rw-r--r--src/guichan/widgets/tab.cpp1
-rw-r--r--src/guichan/widgets/tabbedarea.cpp6
5 files changed, 20 insertions, 2 deletions
diff --git a/src/guichan/widgets/dropdown.cpp b/src/guichan/widgets/dropdown.cpp
index c666b47e4..da7ff754c 100644
--- a/src/guichan/widgets/dropdown.cpp
+++ b/src/guichan/widgets/dropdown.cpp
@@ -106,10 +106,16 @@ namespace gcn
}
if (mInternalScrollArea)
+ {
delete mScrollArea;
+ mScrollArea = 0;
+ }
if (mInternalListBox)
+ {
delete mListBox;
+ mListBox = 0;
+ }
setInternalFocusHandler(NULL);
}
diff --git a/src/guichan/widgets/icon.cpp b/src/guichan/widgets/icon.cpp
index 687fadeab..a040dcc83 100644
--- a/src/guichan/widgets/icon.cpp
+++ b/src/guichan/widgets/icon.cpp
@@ -83,15 +83,14 @@ namespace gcn
if (mInternalImage)
{
delete mImage;
+ mImage = 0;
}
}
void Icon::setImage(const Image* image)
{
if (mInternalImage)
- {
delete mImage;
- }
mImage = image;
mInternalImage = false;
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;
diff --git a/src/guichan/widgets/tab.cpp b/src/guichan/widgets/tab.cpp
index 760e77a18..b0d0c7982 100644
--- a/src/guichan/widgets/tab.cpp
+++ b/src/guichan/widgets/tab.cpp
@@ -69,6 +69,7 @@ namespace gcn
Tab::~Tab()
{
delete mLabel;
+ mLabel = 0;
}
void Tab::adjustSize()
diff --git a/src/guichan/widgets/tabbedarea.cpp b/src/guichan/widgets/tabbedarea.cpp
index d430a76a3..26a45c1f0 100644
--- a/src/guichan/widgets/tabbedarea.cpp
+++ b/src/guichan/widgets/tabbedarea.cpp
@@ -81,10 +81,15 @@ namespace gcn
remove(mWidgetContainer);
delete mTabContainer;
+ mTabContainer = 0;
delete mWidgetContainer;
+ mWidgetContainer = 0;
for (unsigned int i = 0; i < mTabsToDelete.size(); i++)
+ {
delete mTabsToDelete[i];
+ mTabsToDelete[i] = 0;
+ }
}
void TabbedArea::addTab(const std::string& caption, Widget* widget)
@@ -163,6 +168,7 @@ namespace gcn
{
mTabsToDelete.erase(iter2);
delete tab;
+ tab = 0;
break;
}
}