1
0

Changed to have DestroySpells handle luaspell delete instead of active_spells

This commit is contained in:
Emagi 2024-09-10 08:27:05 -04:00
parent 6f8f5016a6
commit 297c17b177
2 changed files with 2 additions and 2 deletions

View File

@ -153,7 +153,7 @@ void LuaInterface::DestroySpells() {
RemoveCurrentSpell(inner_itr->first, inner_itr->second, false, true, false); RemoveCurrentSpell(inner_itr->first, inner_itr->second, false, true, false);
MSpellDelete.unlock(); MSpellDelete.unlock();
lua_close(inner_itr->first); lua_close(inner_itr->first);
// spell is deleted in this context by SpellProcess::DeleteSpell because removing_all_spells = true safe_delete(cur_spell);
} }
Mutex* mutex = GetSpellScriptMutex(spell_script_itr->first.c_str()); Mutex* mutex = GetSpellScriptMutex(spell_script_itr->first.c_str());

View File

@ -67,7 +67,7 @@ void SpellProcess::RemoveAllSpells(bool reload_spells){
active_spells_itr = active_spells.begin(); active_spells_itr = active_spells.begin();
while(active_spells_itr.Next()){ while(active_spells_itr.Next()){
active_spells.Remove(active_spells_itr->value, true); active_spells.Remove(active_spells_itr->value);
} }
active_spells.clear(); active_spells.clear();