revert. Unregister() is "atomic" (useful to call without locking around it).
This commit is contained in:
@@ -204,7 +204,7 @@ void LuaManager::ResetState()
|
|||||||
|
|
||||||
if( L != NULL )
|
if( L != NULL )
|
||||||
{
|
{
|
||||||
LuaReference::BeforeResetAll( L );
|
LuaReference::BeforeResetAll();
|
||||||
|
|
||||||
lua_close( L );
|
lua_close( L );
|
||||||
}
|
}
|
||||||
@@ -222,7 +222,7 @@ void LuaManager::ResetState()
|
|||||||
|
|
||||||
RegisterTypes();
|
RegisterTypes();
|
||||||
|
|
||||||
LuaReference::AfterResetAll( L );
|
LuaReference::AfterResetAll();
|
||||||
|
|
||||||
m_pLock->Unlock();
|
m_pLock->Unlock();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ void LuaReference::Unregister()
|
|||||||
m_iReference = LUA_NOREF;
|
m_iReference = LUA_NOREF;
|
||||||
}
|
}
|
||||||
|
|
||||||
void LuaReference::BeforeResetAll( Lua *L )
|
void LuaReference::BeforeResetAll()
|
||||||
{
|
{
|
||||||
if( SubscriptionManager<LuaReference>::s_pSubscribers == NULL )
|
if( SubscriptionManager<LuaReference>::s_pSubscribers == NULL )
|
||||||
return;
|
return;
|
||||||
@@ -116,7 +116,7 @@ void LuaReference::BeforeResetAll( Lua *L )
|
|||||||
(*p)->BeforeReset();
|
(*p)->BeforeReset();
|
||||||
}
|
}
|
||||||
|
|
||||||
void LuaReference::AfterResetAll( Lua *L )
|
void LuaReference::AfterResetAll()
|
||||||
{
|
{
|
||||||
if( SubscriptionManager<LuaReference>::s_pSubscribers == NULL )
|
if( SubscriptionManager<LuaReference>::s_pSubscribers == NULL )
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ public:
|
|||||||
/* Return the referenced type, or LUA_TNONE if not set. */
|
/* Return the referenced type, or LUA_TNONE if not set. */
|
||||||
int GetLuaType() const;
|
int GetLuaType() const;
|
||||||
|
|
||||||
static void BeforeResetAll( Lua *L ); // call this before resetting Lua
|
static void BeforeResetAll(); // call this before resetting Lua
|
||||||
static void AfterResetAll( Lua *L ); // call this after resetting Lua
|
static void AfterResetAll(); // call this after resetting Lua
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/* If this object needs to store state to recreate itself, overload this. */
|
/* If this object needs to store state to recreate itself, overload this. */
|
||||||
|
|||||||
Reference in New Issue
Block a user