summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/widgets/browserbox_unittest.cc1
-rw-r--r--src/gui/windowmanager_unittest.cc1
-rw-r--r--src/gui/windows/socialwindow.cpp13
3 files changed, 14 insertions, 1 deletions
diff --git a/src/gui/widgets/browserbox_unittest.cc b/src/gui/widgets/browserbox_unittest.cc
index e0ff9e13d..b4e54052c 100644
--- a/src/gui/widgets/browserbox_unittest.cc
+++ b/src/gui/widgets/browserbox_unittest.cc
@@ -148,6 +148,7 @@ TEST_CASE("BrowserBox tests", "browserbox")
row = "##1%%2";
box->addRow(row);
+ delete box;
delete client;
client = nullptr;
}
diff --git a/src/gui/windowmanager_unittest.cc b/src/gui/windowmanager_unittest.cc
index 6ae3b0e34..3f77888d6 100644
--- a/src/gui/windowmanager_unittest.cc
+++ b/src/gui/windowmanager_unittest.cc
@@ -672,5 +672,4 @@ TEST_CASE("Windows tests", "windowmanager")
delete2(client);
delete2(serverFeatures);
delete2(inventoryHandler);
- windowContainer = nullptr;
}
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;