mirror of
https://github.com/EQEmu/Server.git
synced 2026-06-10 10:50:24 +00:00
Merge pull request #1097 from SecretsOTheP/null_ptr_fixes
Null ptr fixes
This commit is contained in:
@@ -857,12 +857,14 @@ void Zone::Shutdown(bool quiet)
|
||||
while (!zone->npctable.empty()) {
|
||||
itr = zone->npctable.begin();
|
||||
delete itr->second;
|
||||
itr->second = nullptr;
|
||||
zone->npctable.erase(itr);
|
||||
}
|
||||
|
||||
while (!zone->merctable.empty()) {
|
||||
itr = zone->merctable.begin();
|
||||
delete itr->second;
|
||||
itr->second = nullptr;
|
||||
zone->merctable.erase(itr);
|
||||
}
|
||||
|
||||
@@ -872,6 +874,7 @@ void Zone::Shutdown(bool quiet)
|
||||
while (!zone->ldon_trap_list.empty()) {
|
||||
itr4 = zone->ldon_trap_list.begin();
|
||||
delete itr4->second;
|
||||
itr4->second = nullptr;
|
||||
zone->ldon_trap_list.erase(itr4);
|
||||
}
|
||||
zone->ldon_trap_entry_list.clear();
|
||||
@@ -1707,6 +1710,7 @@ bool Zone::Depop(bool StartSpawnTimer) {
|
||||
while(!npctable.empty()) {
|
||||
itr = npctable.begin();
|
||||
delete itr->second;
|
||||
itr->second = nullptr;
|
||||
npctable.erase(itr);
|
||||
}
|
||||
|
||||
@@ -1723,6 +1727,7 @@ void Zone::ClearNPCTypeCache(int id) {
|
||||
auto iter = npctable.begin();
|
||||
while (iter != npctable.end()) {
|
||||
delete iter->second;
|
||||
iter->second = nullptr;
|
||||
++iter;
|
||||
}
|
||||
npctable.clear();
|
||||
@@ -1732,6 +1737,7 @@ void Zone::ClearNPCTypeCache(int id) {
|
||||
while (iter != npctable.end()) {
|
||||
if (iter->first == (uint32)id) {
|
||||
delete iter->second;
|
||||
iter->second = nullptr;
|
||||
npctable.erase(iter);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user