Skip to content

Commit 3a00046

Browse files
committed
CLuaManager: fix pointer use after memory release
1 parent 57dfd05 commit 3a00046

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Client/mods/deathmatch/logic/lua/CLuaManager.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,15 @@ bool CLuaManager::RemoveVirtualMachine(CLuaMain* pLuaMain)
6868
m_pEvents->RemoveAllEvents(pLuaMain);
6969
m_pRegisteredCommands->CleanUpForVM(pLuaMain);
7070

71+
// Remove it from our list
72+
m_virtualMachines.remove(pLuaMain);
73+
7174
// Delete it unless it is already
7275
if (!pLuaMain->BeingDeleted())
7376
{
7477
delete pLuaMain;
7578
}
7679

77-
// Remove it from our list
78-
m_virtualMachines.remove(pLuaMain);
7980
return true;
8081
}
8182

0 commit comments

Comments
 (0)