mirror of
https://github.com/TombEngine/TombEngine.git
synced 2025-04-30 00:37:58 +03:00
Set callbacks to nil and collect garbage when unloading level.
This commit is contained in:
parent
770a791c0d
commit
578724a9c6
1 changed files with 6 additions and 0 deletions
|
@ -442,6 +442,12 @@ void GameScript::FreeLevelScripts()
|
|||
m_levelFuncs.clear();
|
||||
m_locals = LuaVariables{};
|
||||
ResetLevelTables();
|
||||
m_onStart = sol::nil;
|
||||
m_onLoad = sol::nil;
|
||||
m_onControlPhase = sol::nil;
|
||||
m_onSave = sol::nil;
|
||||
m_onEnd = sol::nil;
|
||||
m_lua->collect_garbage();
|
||||
}
|
||||
|
||||
void JumpToLevel(int levelNum)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue