summaryrefslogtreecommitdiff
path: root/src/gui/windows/minimap.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-03 12:25:27 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-03 12:25:27 +0300
commitda87d0f7ce54182e3ea89a512ce3c24d5d06405e (patch)
treee08a5503e6ec45285b61ad06b56309184507087a /src/gui/windows/minimap.cpp
parent3279c64d25124dbe759f7ba4fffe5554c3dd9e1e (diff)
downloadplus-da87d0f7ce54182e3ea89a512ce3c24d5d06405e.tar.gz
plus-da87d0f7ce54182e3ea89a512ce3c24d5d06405e.tar.bz2
plus-da87d0f7ce54182e3ea89a512ce3c24d5d06405e.tar.xz
plus-da87d0f7ce54182e3ea89a512ce3c24d5d06405e.zip
Remove duplicate code from minimap.
Diffstat (limited to 'src/gui/windows/minimap.cpp')
-rw-r--r--src/gui/windows/minimap.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/src/gui/windows/minimap.cpp b/src/gui/windows/minimap.cpp
index 9be6d7304..70a2361cd 100644
--- a/src/gui/windows/minimap.cpp
+++ b/src/gui/windows/minimap.cpp
@@ -89,7 +89,12 @@ Minimap::~Minimap()
config.setValue(getWindowName() + "Show", mShow);
config.removeListeners(this);
CHECKLISTENERS
+ deleteMapImage();
+ delete2(mTextPopup);
+}
+void Minimap::deleteMapImage()
+{
if (mMapImage)
{
if (mCustomMapImage)
@@ -98,7 +103,6 @@ Minimap::~Minimap()
mMapImage->decRef();
mMapImage = nullptr;
}
- delete2(mTextPopup);
}
void Minimap::setMap(const Map *const map)
@@ -115,16 +119,7 @@ void Minimap::setMap(const Map *const map)
}
setCaption(caption);
-
- // Adapt the image
- if (mMapImage)
- {
- if (mCustomMapImage)
- delete mMapImage;
- else
- mMapImage->decRef();
- mMapImage = nullptr;
- }
+ deleteMapImage();
if (map)
{