Eluna fix crash on shutdown, closes #71

This commit is contained in:
Rochet2
2014-07-03 19:08:58 +03:00
parent df480f976d
commit 873d6a9537

View File

@@ -44,6 +44,7 @@ void Eluna::Initialize()
void Eluna::Uninitialize()
{
delete GEluna;
GEluna = NULL;
lua_scripts.clear();
lua_extensions.clear();
}
@@ -241,6 +242,8 @@ void Eluna::RunScripts()
void Eluna::RemoveRef(const void* obj)
{
if (!sEluna)
return;
lua_rawgeti(sEluna->L, LUA_REGISTRYINDEX, sEluna->userdata_table);
lua_pushfstring(sEluna->L, "%p", obj);
lua_gettable(sEluna->L, -2);