From: John L. <jr...@us...> - 2007-08-02 23:09:02
|
Update of /cvsroot/wxlua/wxLua/modules/wxluadebug/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv16855/wxLua/modules/wxluadebug/src Modified Files: wxldebug.cpp Log Message: Fix for wxLuaFunctions in wxlua_tpushusertag, don't try to reuse the userdata since wxLuaFunctions are one shot only. If in an event handler and wx.wxPostEvent(win, wx.wxCommandEvent(..)) was called and ALSO handled by the window the memory from the temp event could be reused by the wxLuaFunction and wxlua_tpushusertag would return the old userdata at the reused address which was wrong. Clear things in wxlcallb.cpp for deleted windows Don't use 0x%p since gcc adds 0x for us, however MSVC6 doesn't Index: wxldebug.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxluadebug/src/wxldebug.cpp,v retrieving revision 1.40 retrieving revision 1.41 diff -C2 -d -r1.40 -r1.41 *** wxldebug.cpp 26 Jul 2007 18:56:39 -0000 1.40 --- wxldebug.cpp 2 Aug 2007 23:08:58 -0000 1.41 *************** *** 283,291 **** int nTop = lua_gettop(L); - wxlua_pushkey_wxLuaObjects(L); - lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the obj table) - bool is_lreg_objTable = (lua_equal(L, -1, -2) != 0); - lua_pop(L, 1); - // start iterating lua_pushnil(L); --- 283,286 ---- *************** *** 414,418 **** long num = (long) dnum; if ((double) num == dnum) ! return wxString::Format(wxT("%ld (0x%lx)"), num, num); return wxString::Format(wxT("%g"), dnum); --- 409,413 ---- long num = (long) dnum; if ((double) num == dnum) ! return wxString::Format(wxT("%ld (0x%lx)"), num, (unsigned long)num); return wxString::Format(wxT("%g"), dnum); *************** *** 433,437 **** const void *pItem = lua_topointer(L, index); ! wxString s = wxString::Format(wxT("0x%p"), pItem); if (nItems > 0) --- 428,432 ---- const void *pItem = lua_topointer(L, index); ! wxString s = wxString::Format(wxT("%p"), pItem); if (nItems > 0) *************** *** 450,454 **** lua_State* L = wxlState.GetLuaState(); ! wxString s = wxString::Format(wxT("0x%p"), lua_touserdata(L, index)); void* udata = lua_touserdata(L, index); --- 445,449 ---- lua_State* L = wxlState.GetLuaState(); ! wxString s = wxString::Format(wxT("%p"), lua_touserdata(L, index)); void* udata = lua_touserdata(L, index); |