From 35d327a5ab3ae2a235e3e045afb321810bb2536a Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 3 Jun 2011 13:42:29 +0300 Subject: Fix memory leak in party. --- src/party.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/party.cpp b/src/party.cpp index 9f0541224..e3ea497ac 100644 --- a/src/party.cpp +++ b/src/party.cpp @@ -284,8 +284,9 @@ Party *Party::getParty(short id) PartyMap::iterator it = parties.find(id); if (it != parties.end()) return it->second; - - return new Party(id); + Party *party = new Party(id); + parties[id] = party; + return party; } void Party::sort() -- cgit v1.2.3-70-g09d2