From: John L. <jr...@us...> - 2007-08-14 13:42:19
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv3043/wxLua/modules/wxlua/src Modified Files: wxlstate.cpp Log Message: Fix ambiguous call to wxLuaState(...) in cansum.cpp A little cleanup for the wxluacan app Update luamodule.cpp to use new enums for wxLuaState(lua_State, ...) Nil the wxLuaState lookup in the registry table when the wxLuaState is closed Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.133 retrieving revision 1.134 diff -C2 -d -r1.133 -r1.134 *** wxlstate.cpp 10 Aug 2007 21:23:39 -0000 1.133 --- wxlstate.cpp 14 Aug 2007 13:42:15 -0000 1.134 *************** *** 1317,1332 **** ClearCallbacks(); ! ! if ((m_lua_State != NULL) && !m_lua_State_static) { UnRegisterBindings(); ! lua_close(m_lua_State); ! } ! // Clear out the wxLuaState we hashed, note it's not refed so we have ! // NULL it's ref data. ! // Note: even though the lua_State is closed the pointer value is still good. ! if (m_lua_State != NULL) ! { wxHashMapLuaState::iterator it = s_wxHashMapLuaState.find(m_lua_State); if (it != s_wxHashMapLuaState.end()) --- 1317,1330 ---- ClearCallbacks(); ! if (m_lua_State != NULL) { UnRegisterBindings(); ! ! if (!m_lua_State_static) ! lua_close(m_lua_State); ! // Clear out the wxLuaState we hashed, note it's not refed so we have ! // NULL it's ref data. ! // Note: even though the lua_State is closed the pointer value is still good. wxHashMapLuaState::iterator it = s_wxHashMapLuaState.find(m_lua_State); if (it != s_wxHashMapLuaState.end()) *************** *** 1386,1389 **** --- 1384,1391 ---- } + wxlua_pushkey_wxLuaState(m_lua_State); + lua_pushnil(m_lua_State); + lua_rawset(m_lua_State, LUA_REGISTRYINDEX); + wxlua_pushkey_wxLuaReferences(m_lua_State); lua_pushnil(m_lua_State); |