From c5e926c01a5a767ed73286b4b5570a4bbb0a26ac Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 30 Aug 2016 01:14:47 +0300 Subject: Fix some leaks in unit tests. --- src/gui/windows/socialwindow.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/gui/windows/socialwindow.cpp') 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; -- cgit v1.2.3-70-g09d2