Update of /cvsroot/wxlua/wxLua/modules/wxlua/src
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv13320/wxLua/modules/wxlua/src
Modified Files:
wxlbind.cpp wxlstate.cpp
Log Message:
Include wxluasetup.h from within the bindings rather than from
modules/wxbind/wxbinddefs.h so other's don't have to include it.
Fix collecting userdata prematurely, track the userdata on the pointer
Lua creates instead of the data itself.
Index: wxlstate.cpp
===================================================================
RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v
retrieving revision 1.120
retrieving revision 1.121
diff -C2 -d -r1.120 -r1.121
*** wxlstate.cpp 16 Jul 2007 19:35:30 -0000 1.120
--- wxlstate.cpp 17 Jul 2007 03:30:23 -0000 1.121
***************
*** 355,362 ****
{
wxlua_pushkey_wxLuaObjects(L);
! lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the obj table)
! lua_pushlightuserdata(L, (void*)u);
! lua_pushnumber(L, tag); // t["lightuserdata ptr"] = tag
lua_rawset(L, -3);
lua_pop(L, 1);
--- 355,362 ----
{
wxlua_pushkey_wxLuaObjects(L);
! lua_rawget(L, LUA_REGISTRYINDEX); // pop key, push result (the obj table)
! lua_pushlightuserdata(L, (void**)u); // key on Lua's userdata
! lua_pushnumber(L, tag); // t["lightuserdata ptr"] = tag
lua_rawset(L, -3);
lua_pop(L, 1);
Index: wxlbind.cpp
===================================================================
RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlbind.cpp,v
retrieving revision 1.83
retrieving revision 1.84
diff -C2 -d -r1.83 -r1.84
*** wxlbind.cpp 28 Jun 2007 22:45:57 -0000 1.83
--- wxlbind.cpp 17 Jul 2007 03:30:22 -0000 1.84
***************
*** 249,253 ****
wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState"));
! void* key = wxlua_ttouserdata(L, 1, true);
wxCHECK_MSG(key != 0, 0, wxT("NULL user data in wxluabind_gc_wxLuaBindClass"));
--- 249,255 ----
wxCHECK_MSG(wxlState.Ok(), 0, wxT("Invalid wxLuaState"));
! void* key = lua_touserdata(L, 1);
! wxlua_ttouserdata(L, 1, true);
!
wxCHECK_MSG(key != 0, 0, wxT("NULL user data in wxluabind_gc_wxLuaBindClass"));
|