mirror of
https://github.com/azerothcore/mod-ale
synced 2025-11-29 15:38:17 +08:00
Eluna fix crash on shutdown, closes #71
This commit is contained in:
@@ -44,6 +44,7 @@ void Eluna::Initialize()
|
|||||||
void Eluna::Uninitialize()
|
void Eluna::Uninitialize()
|
||||||
{
|
{
|
||||||
delete GEluna;
|
delete GEluna;
|
||||||
|
GEluna = NULL;
|
||||||
lua_scripts.clear();
|
lua_scripts.clear();
|
||||||
lua_extensions.clear();
|
lua_extensions.clear();
|
||||||
}
|
}
|
||||||
@@ -241,6 +242,8 @@ void Eluna::RunScripts()
|
|||||||
|
|
||||||
void Eluna::RemoveRef(const void* obj)
|
void Eluna::RemoveRef(const void* obj)
|
||||||
{
|
{
|
||||||
|
if (!sEluna)
|
||||||
|
return;
|
||||||
lua_rawgeti(sEluna->L, LUA_REGISTRYINDEX, sEluna->userdata_table);
|
lua_rawgeti(sEluna->L, LUA_REGISTRYINDEX, sEluna->userdata_table);
|
||||||
lua_pushfstring(sEluna->L, "%p", obj);
|
lua_pushfstring(sEluna->L, "%p", obj);
|
||||||
lua_gettable(sEluna->L, -2);
|
lua_gettable(sEluna->L, -2);
|
||||||
|
|||||||
Reference in New Issue
Block a user