From: John L. <jr...@us...> - 2008-01-05 00:15:49
|
Update of /cvsroot/wxlua/wxLua/bindings/wxlua In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv10306/wxLua/bindings/wxlua Modified Files: override.hpp wxlua.i Log Message: A little more cleanup. Fix for Lua clearing weak refs even before the __gc call is made so we miscounted how many instances of the userdata we had and deleted it thinking it was the last. Index: wxlua.i =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/wxlua.i,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** wxlua.i 22 Dec 2007 06:07:08 -0000 1.14 --- wxlua.i 5 Jan 2008 00:15:45 -0000 1.15 *************** *** 29,50 **** // Get information about the status of wxLua. ! // Get a table of all tracked top level windows that wxLua will Destroy() ! // when lua is closed. // Example output : { "ClassName(&win id=wxWindowID)", ...} ! %function LuaTable GetTrackedWindowInfo() ! // Get a table of all tracked userdata wxLua will delete when lua is closed ! // or lua will eventually garbage collect. // Example output : { "ClassName(&obj)", ... } ! %function LuaTable GetGCUserdataInfo() ! // Get a table of all tracked wxEvent callbacks that have been installed using ! // wxEvtHandler::Connect(...) // "wxEVT_XXX(evt#) -> wxLuaEventCallback(&callback, ids %d %d)|wxEvtHandler(&evthandler) -> wxEvtHandlerClassName" ! %function LuaTable GetTrackedEventCallbackInfo() ! // Get a table of all wxWindow derived classes that have been created in wxLua. // "wxWindowClassName(&win, id=%d)|wxLuaDestroyCallback(&callback)" ! %function LuaTable GetTrackedWinDestroyCallbackInfo() // --------------------------------------------------------------------------- --- 29,55 ---- // Get information about the status of wxLua. ! // Get a table or string of all tracked top level windows that wxLua will ! // Destroy() when lua is closed. // Example output : { "ClassName(&win id=wxWindowID)", ...} ! %function LuaTable GetTrackedWindowInfo(bool as_string = false) ! // Get a table or string of all tracked userdata wxLua will delete when lua ! // is closed or lua will eventually garbage collect. // Example output : { "ClassName(&obj)", ... } ! %function LuaTable GetGCUserdataInfo(bool as_string = false) ! // Get a table or string of all tracked userdata wxLua has pushed. ! // A single object may have multiple types if it has been casted. ! // Example output : { "&obj wxLuaTypeName(type#), ...", ... } ! %function LuaTable GetTrackedObjectInfo(bool as_string = false) ! ! // Get a table or string of all tracked wxEvent callbacks that have been ! // installed using wxEvtHandler::Connect(...) // "wxEVT_XXX(evt#) -> wxLuaEventCallback(&callback, ids %d %d)|wxEvtHandler(&evthandler) -> wxEvtHandlerClassName" ! %function LuaTable GetTrackedEventCallbackInfo(bool as_string = false) ! // Get a table or string of all wxWindow derived classes that have been created in wxLua. // "wxWindowClassName(&win, id=%d)|wxLuaDestroyCallback(&callback)" ! %function LuaTable GetTrackedWinDestroyCallbackInfo(bool as_string = false) // --------------------------------------------------------------------------- Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/override.hpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** override.hpp 22 Dec 2007 06:07:08 -0000 1.16 --- override.hpp 5 Jan 2008 00:15:45 -0000 1.17 *************** *** 32,39 **** %override wxLua_function_GetTrackedWindowInfo ! // %function LuaTable GetTrackedTopLevelWindows() static int LUACALL wxLua_function_GetTrackedWindowInfo(lua_State *L) { ! wxlua_pushwxArrayStringtable(L, wxluaW_gettrackedwindowinfo(L)); return 1; } --- 32,44 ---- %override wxLua_function_GetTrackedWindowInfo ! // %function LuaTable GetTrackedWindowInfo(bool as_string = false) static int LUACALL wxLua_function_GetTrackedWindowInfo(lua_State *L) { ! bool as_string = lua_toboolean(L, 1); // ok if nil ! if (as_string) ! wxlua_pushwxString(L, wxlua_concatwxArrayString(wxluaW_gettrackedwindowinfo(L))); ! else ! wxlua_pushwxArrayStringtable(L, wxluaW_gettrackedwindowinfo(L)); ! return 1; } *************** *** 41,48 **** %override wxLua_function_GetGCUserdataInfo ! // %function LuaTable GetTrackedUserData() static int LUACALL wxLua_function_GetGCUserdataInfo(lua_State *L) { ! wxlua_pushwxArrayStringtable(L, wxluaO_getgcobjectinfo(L)); return 1; } --- 46,72 ---- %override wxLua_function_GetGCUserdataInfo ! // %function LuaTable GetGCUserdataInfo(bool as_string = false) static int LUACALL wxLua_function_GetGCUserdataInfo(lua_State *L) { ! bool as_string = lua_toboolean(L, 1); // ok if nil ! if (as_string) ! wxlua_pushwxString(L, wxlua_concatwxArrayString(wxluaO_getgcobjectinfo(L))); ! else ! wxlua_pushwxArrayStringtable(L, wxluaO_getgcobjectinfo(L)); ! ! return 1; ! } ! %end ! ! %override wxLua_function_GetTrackedObjectInfo ! // %function LuaTable GetTrackedObjectInfo(bool as_string = false) ! static int LUACALL wxLua_function_GetTrackedObjectInfo(lua_State *L) ! { ! bool as_string = lua_toboolean(L, 1); // ok if nil ! if (as_string) ! wxlua_pushwxString(L, wxlua_concatwxArrayString(wxluaO_gettrackedweakobjectinfo(L))); ! else ! wxlua_pushwxArrayStringtable(L, wxluaO_gettrackedweakobjectinfo(L)); ! return 1; } *************** *** 50,58 **** %override wxLua_function_GetTrackedEventCallbackInfo ! // %function LuaTable GetTrackedEventCallbackInfo() static int LUACALL wxLua_function_GetTrackedEventCallbackInfo(lua_State *L) { wxLuaState wxlState(L); ! wxlua_pushwxArrayStringtable(L, wxlState.GetTrackedEventCallbackInfo()); return 1; } --- 74,87 ---- %override wxLua_function_GetTrackedEventCallbackInfo ! // %function LuaTable GetTrackedEventCallbackInfo(bool as_string = false) static int LUACALL wxLua_function_GetTrackedEventCallbackInfo(lua_State *L) { wxLuaState wxlState(L); ! bool as_string = lua_toboolean(L, 1); // ok if nil ! if (as_string) ! wxlua_pushwxString(L, wxlua_concatwxArrayString(wxlState.GetTrackedEventCallbackInfo())); ! else ! wxlua_pushwxArrayStringtable(L, wxlState.GetTrackedEventCallbackInfo()); ! return 1; } *************** *** 60,68 **** %override wxLua_function_GetTrackedWinDestroyCallbackInfo ! // %function LuaTable GetTrackedWinDestroyCallbackInfo() static int LUACALL wxLua_function_GetTrackedWinDestroyCallbackInfo(lua_State *L) { wxLuaState wxlState(L); ! wxlua_pushwxArrayStringtable(L, wxlState.GetTrackedWinDestroyCallbackInfo()); return 1; } --- 89,102 ---- %override wxLua_function_GetTrackedWinDestroyCallbackInfo ! // %function LuaTable GetTrackedWinDestroyCallbackInfo(bool as_string = false) static int LUACALL wxLua_function_GetTrackedWinDestroyCallbackInfo(lua_State *L) { wxLuaState wxlState(L); ! bool as_string = lua_toboolean(L, 1); // ok if nil ! if (as_string) ! wxlua_pushwxString(L, wxlua_concatwxArrayString(wxlState.GetTrackedWinDestroyCallbackInfo())); ! else ! wxlua_pushwxArrayStringtable(L, wxlState.GetTrackedWinDestroyCallbackInfo()); ! return 1; } |