summaryrefslogtreecommitdiff
path: root/src/party.cpp
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-03-30 13:16:43 -0600
committerJared Adams <jaxad0127@gmail.com>2010-03-30 14:29:28 -0600
commit0c8fd1b9e6a4840bb573c26602f439e7c6ab9d7d (patch)
tree2996cae62236089221bc7c7bad6e834021db6114 /src/party.cpp
parent43abf72c78b492fa1cd383dac3990ee331c217ef (diff)
downloadmana-0c8fd1b9e6a4840bb573c26602f439e7c6ab9d7d.tar.gz
mana-0c8fd1b9e6a4840bb573c26602f439e7c6ab9d7d.tar.bz2
mana-0c8fd1b9e6a4840bb573c26602f439e7c6ab9d7d.tar.xz
mana-0c8fd1b9e6a4840bb573c26602f439e7c6ab9d7d.zip
Fix some memory issues
Reviewed-by: Thorbjørn Lindeijer
Diffstat (limited to 'src/party.cpp')
-rw-r--r--src/party.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/party.cpp b/src/party.cpp
index b47c194a..22740489 100644
--- a/src/party.cpp
+++ b/src/party.cpp
@@ -46,6 +46,12 @@ Party::Party(short id):
{
parties[id] = this;
}
+
+Party::~Party()
+{
+ clearMembers();
+}
+
PartyMember *Party::addMember(int id, const std::string &name)
{
PartyMember *m;
@@ -132,7 +138,9 @@ void Party::removeMember(PartyMember *member)
if((*itr)->mId == member->mId &&
(*itr)->getName() == member->getName())
{
+ PartyMember *member = (*itr);
mMembers.erase(itr);
+ delete member;
}
++itr;
}
@@ -146,7 +154,9 @@ void Party::removeMember(int id)
{
if((*itr)->mId == id)
{
+ PartyMember *member = (*itr);
mMembers.erase(itr);
+ delete member;
}
++itr;
}
@@ -160,7 +170,9 @@ void Party::removeMember(const std::string &name)
{
if((*itr)->getName() == name)
{
+ PartyMember *member = (*itr);
mMembers.erase(itr);
+ delete member;
}
++itr;
}