summaryrefslogtreecommitdiff
path: root/src/guild.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/guild.cpp')
-rw-r--r--src/guild.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/guild.cpp b/src/guild.cpp
index c7a9c0cdc..2e1b3d78c 100644
--- a/src/guild.cpp
+++ b/src/guild.cpp
@@ -148,8 +148,9 @@ void Guild::removeMember(GuildMember *member)
(*itr)->mCharId == member->mCharId &&
(*itr)->getName() == member->getName())
{
+ GuildMember *member = *itr;
mMembers.erase(itr);
- delete *itr;
+ delete member;
return;
}
++itr;
@@ -159,16 +160,18 @@ void Guild::removeMember(GuildMember *member)
void Guild::removeMember(int id)
{
bool deleted = true;
- MemberList::iterator itr = mMembers.begin(),
- itr_end = mMembers.end();
while (deleted)
{
deleted = false;
+ MemberList::iterator itr = mMembers.begin(),
+ itr_end = mMembers.end();
while (itr != itr_end)
{
if ((*itr)->mId == id)
{
+ GuildMember *member = *itr;
mMembers.erase(itr);
+ delete member;
deleted = true;
break;
}
@@ -180,16 +183,18 @@ void Guild::removeMember(int id)
void Guild::removeMember(const std::string &name)
{
bool deleted = true;
- MemberList::iterator itr = mMembers.begin(),
- itr_end = mMembers.end();
while (deleted)
{
deleted = false;
+ MemberList::iterator itr = mMembers.begin(),
+ itr_end = mMembers.end();
while (itr != itr_end)
{
if ((*itr)->getName() == name)
{
+ GuildMember *member = *itr;
mMembers.erase(itr);
+ delete member;
deleted = true;
break;
}