From: John L. <jr...@us...> - 2010-12-03 04:39:51
|
Update of /cvsroot/wxlua/wxLua/bindings/wxwidgets In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv5929/wxLua/bindings/wxwidgets Modified Files: wxcore_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: wxcore_override.hpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/bindings/wxwidgets/wxcore_override.hpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** wxcore_override.hpp 1 Oct 2009 04:21:01 -0000 1.21 --- wxcore_override.hpp 3 Dec 2010 04:39:43 -0000 1.22 *************** *** 652,656 **** { wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 2, wxluatype_wxLuaObject); ! returns = new wxTextValidator(style, valPtr->GetStringPtr()); } else --- 652,656 ---- { wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 2, wxluatype_wxLuaObject); ! returns = new wxTextValidator(style, valPtr->GetStringPtr(L)); } else *************** *** 671,675 **** wxLuaObject *boolPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaObject); // call constructor ! wxGenericValidator *returns = new wxGenericValidator(boolPtr->GetBoolPtr()); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxGenericValidator); --- 671,675 ---- wxLuaObject *boolPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaObject); // call constructor ! wxGenericValidator *returns = new wxGenericValidator(boolPtr->GetBoolPtr(L)); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxGenericValidator); *************** *** 688,692 **** wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaObject); // call constructor ! wxGenericValidator *returns = new wxGenericValidator(valPtr->GetStringPtr()); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxGenericValidator); --- 688,692 ---- wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaObject); // call constructor ! wxGenericValidator *returns = new wxGenericValidator(valPtr->GetStringPtr(L)); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxGenericValidator); *************** *** 705,709 **** wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaObject); // call constructor ! wxGenericValidator *returns = new wxGenericValidator(valPtr->GetIntPtr()); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxGenericValidator); --- 705,709 ---- wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaObject); // call constructor ! wxGenericValidator *returns = new wxGenericValidator(valPtr->GetIntPtr(L)); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxGenericValidator); *************** *** 722,726 **** wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaObject); // call constructor ! wxGenericValidator *returns = new wxGenericValidator(valPtr->GetArrayPtr()); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxGenericValidator); --- 722,726 ---- wxLuaObject *valPtr = (wxLuaObject *)wxluaT_getuserdatatype(L, 1, wxluatype_wxLuaObject); // call constructor ! wxGenericValidator *returns = new wxGenericValidator(valPtr->GetArrayPtr(L)); // add to tracked memory list wxluaO_addgcobject(L, returns, wxluatype_wxGenericValidator); |