summaryrefslogtreecommitdiff
path: root/src/gui/windows/socialwindow.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2016-08-30 01:14:47 +0300
committerAndrei Karas <akaras@inbox.ru>2016-08-30 01:14:47 +0300
commitc5e926c01a5a767ed73286b4b5570a4bbb0a26ac (patch)
tree52e0c216cdfbc38a271d3d566b8e6d466765f737 /src/gui/windows/socialwindow.cpp
parentede06c1fe25184b1232687950ce79dc29352c00b (diff)
downloadplus-c5e926c01a5a767ed73286b4b5570a4bbb0a26ac.tar.gz
plus-c5e926c01a5a767ed73286b4b5570a4bbb0a26ac.tar.bz2
plus-c5e926c01a5a767ed73286b4b5570a4bbb0a26ac.tar.xz
plus-c5e926c01a5a767ed73286b4b5570a4bbb0a26ac.zip
Fix some leaks in unit tests.
Diffstat (limited to 'src/gui/windows/socialwindow.cpp')
-rw-r--r--src/gui/windows/socialwindow.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/gui/windows/socialwindow.cpp b/src/gui/windows/socialwindow.cpp
index 0ab894ba6..d98fec4f1 100644
--- a/src/gui/windows/socialwindow.cpp
+++ b/src/gui/windows/socialwindow.cpp
@@ -168,6 +168,16 @@ SocialWindow::~SocialWindow()
delete2(mAttackFilter);
delete2(mPickupFilter);
delete2(mFriends);
+ FOR_EACH (GuildMap::iterator, it, mGuilds)
+ {
+ delete (*it).second;
+ }
+ mGuilds.clear();
+ FOR_EACH (PartyMap::iterator, it, mParties)
+ {
+ delete (*it).second;
+ }
+ mParties.clear();
}
bool SocialWindow::addTab(Guild *const guild)
@@ -217,6 +227,9 @@ bool SocialWindow::removeTab(Guild *const guild)
bool SocialWindow::addTab(Party *const party)
{
+ if (!party)
+ return false;
+
if (mParties.find(party) != mParties.end())
return false;