From: John L. <jr...@us...> - 2010-12-03 04:39:51
|
Update of /cvsroot/wxlua/wxLua/bindings/wxlua In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv5929/wxLua/bindings/wxlua Modified Files: override.hpp Log Message: Fix wxLuaObject to take a lua_State for all functions so that it works with coroutines. Send an error message in Lua is trying to install a wxEventHandler from a coroutine since a) it will only be called when the thread is suspended or dead b) we cannot track when the coroutine state is closed so we will call an invalid lua_State Index: override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxlua/override.hpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** override.hpp 21 Dec 2009 04:06:10 -0000 1.25 --- override.hpp 3 Dec 2010 04:39:43 -0000 1.26 *************** *** 900,908 **** static int LUACALL wxLua_wxLuaObject_constructor(lua_State *L) { - wxLuaState wxlState(L); - wxLuaObject *returns; // call constructor ! returns = new wxLuaObject(wxlState, 1); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxLuaObject); --- 900,906 ---- static int LUACALL wxLua_wxLuaObject_constructor(lua_State *L) { wxLuaObject *returns; // call constructor ! returns = new wxLuaObject(L, 1); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxLuaObject); *************** *** 921,925 **** wxLuaObject *self = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaObject); // call SetObject ! self->SetObject(1); // return the number of parameters return 0; --- 919,923 ---- wxLuaObject *self = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaObject); // call SetObject ! self->SetObject(L, 1); // return the number of parameters return 0; *************** *** 934,938 **** wxLuaObject *self = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaObject); // call GetObject that push the item onto the stack, or nil ! if (self->GetObject()) return 1; --- 932,936 ---- wxLuaObject *self = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaObject); // call GetObject that push the item onto the stack, or nil ! if (self->GetObject(L)) return 1; |