Fix null pointers in group/raid pointer removal

This commit is contained in:
E Spause 2020-07-19 02:30:50 -04:00
parent fc6689ec09
commit eacd2c2cde

View File

@ -2476,7 +2476,7 @@ void EntityList::RemoveAllGroups()
while (group_list.size()) { while (group_list.size()) {
auto group = group_list.front(); auto group = group_list.front();
group_list.pop_front(); group_list.pop_front();
delete group; safe_delete(group);
} }
#if EQDEBUG >= 5 #if EQDEBUG >= 5
CheckGroupList (__FILE__, __LINE__); CheckGroupList (__FILE__, __LINE__);
@ -2488,7 +2488,7 @@ void EntityList::RemoveAllRaids()
while (raid_list.size()) { while (raid_list.size()) {
auto raid = raid_list.front(); auto raid = raid_list.front();
raid_list.pop_front(); raid_list.pop_front();
delete raid; safe_delete(raid);
} }
} }
@ -2838,7 +2838,7 @@ bool EntityList::RemoveGroup(uint32 delete_id)
} }
auto group = *it; auto group = *it;
group_list.erase(it); group_list.erase(it);
delete group; safe_delete(group);
return true; return true;
} }
@ -2850,7 +2850,7 @@ bool EntityList::RemoveRaid(uint32 delete_id)
return false; return false;
auto raid = *it; auto raid = *it;
raid_list.erase(it); raid_list.erase(it);
delete raid; safe_delete(raid);
return true; return true;
} }