Update of /cvsroot/wxlua/wxLua/modules/wxbind/src In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv15370/wxLua/modules/wxbind/src Modified Files: wxadv_adv.cpp wxadv_grid.cpp wxaui_aui.cpp wxbase_base.cpp wxbase_bind.cpp wxbase_config.cpp wxbase_data.cpp wxbase_datetime.cpp wxbase_file.cpp wxcore_appframe.cpp wxcore_bind.cpp wxcore_clipdrag.cpp wxcore_controls.cpp wxcore_core.cpp wxcore_defsutils.cpp wxcore_dialogs.cpp wxcore_event.cpp wxcore_gdi.cpp wxcore_geometry.cpp wxcore_help.cpp wxcore_image.cpp wxcore_mdi.cpp wxcore_menutool.cpp wxcore_picker.cpp wxcore_print.cpp wxcore_sizer.cpp wxcore_windows.cpp wxcore_wxlprint.cpp wxhtml_html.cpp wxmedia_media.cpp wxnet_net.cpp wxstc_stc.cpp wxxml_xml.cpp wxxrc_xrc.cpp Log Message: * Allowed using wxObject:DynamicCast() on an object and be able to use the object as both types. The problem was that wxEvent:GetEventObject() returned a wxObject which overwrote the wxWindow (perhaps) that you had as a userdata in Lua already. Additionally, if you delete an object all of the userdata that wrap it have their metatables cleared for safety. Functions renamed since they didn't do the same thing or behave the same. wxluaO_istrackedobject -> wxluaO_isgcobject wxluaO_addtrackedobject -> wxluaO_addgcobject wxluaO_removetrackedobject -> wxluaO_deletegcobject - Created a central luauserdata:delete() function for the bindings to reduce code. wxLua_wxluabind_delete(L) wxLuaStackDialog: You can expand both key and values of a table and more information is provided about items wxLua knows about. Index: wxnet_net.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxnet_net.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxnet_net.cpp 10 Dec 2007 05:39:08 -0000 1.6 --- wxnet_net.cpp 13 Dec 2007 00:47:51 -0000 1.7 *************** *** 727,743 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxSocketClient_delete[] = { &s_wxluatag_wxSocketClient, NULL }; ! static int LUACALL wxLua_wxSocketClient_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxSocketClient_delete[1] = {{ wxLua_wxSocketClient_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxSocketClient_delete }}; ! static int LUACALL wxLua_wxSocketClient_delete(lua_State *L) ! { ! wxSocketClient * self = (wxSocketClient *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxSocketClient); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxSocketClient_constructor[] = { &s_wxluaarg_Integer, NULL }; --- 727,731 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxSocketClient_delete[] = { &s_wxluatag_wxSocketClient, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxSocketClient_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxSocketClient_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxSocketClient_constructor[] = { &s_wxluaarg_Integer, NULL }; *************** *** 755,759 **** wxSocketClient* returns = new wxSocketClient(flags); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxSocketClient, returns); --- 743,747 ---- wxSocketClient* returns = new wxSocketClient(flags); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxSocketClient, returns); *************** *** 853,869 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxSocketServer_delete[] = { &s_wxluatag_wxSocketServer, NULL }; ! static int LUACALL wxLua_wxSocketServer_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxSocketServer_delete[1] = {{ wxLua_wxSocketServer_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxSocketServer_delete }}; ! static int LUACALL wxLua_wxSocketServer_delete(lua_State *L) ! { ! wxSocketServer * self = (wxSocketServer *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxSocketServer); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxSocketServer_constructor[] = { &s_wxluatag_wxSockAddress, &s_wxluaarg_Integer, NULL }; --- 841,845 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxSocketServer_delete[] = { &s_wxluatag_wxSocketServer, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxSocketServer_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxSocketServer_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxSocketServer_constructor[] = { &s_wxluatag_wxSockAddress, &s_wxluaarg_Integer, NULL }; *************** *** 883,887 **** wxSocketServer* returns = new wxSocketServer(*address, flags); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxSocketServer, returns); --- 859,863 ---- wxSocketServer* returns = new wxSocketServer(*address, flags); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxSocketServer, returns); *************** *** 966,982 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxSocketEvent_delete[] = { &s_wxluatag_wxSocketEvent, NULL }; ! static int LUACALL wxLua_wxSocketEvent_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxSocketEvent_delete[1] = {{ wxLua_wxSocketEvent_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxSocketEvent_delete }}; ! static int LUACALL wxLua_wxSocketEvent_delete(lua_State *L) ! { ! wxSocketEvent * self = (wxSocketEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxSocketEvent); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxSocketEvent_constructor[] = { &s_wxluaarg_Number, NULL }; --- 942,946 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxSocketEvent_delete[] = { &s_wxluatag_wxSocketEvent, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxSocketEvent_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxSocketEvent_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxSocketEvent_constructor[] = { &s_wxluaarg_Number, NULL }; *************** *** 994,998 **** wxSocketEvent* returns = new wxSocketEvent(id); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxSocketEvent, returns); --- 958,962 ---- wxSocketEvent* returns = new wxSocketEvent(id); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxSocketEvent, returns); *************** *** 1216,1232 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxIPaddress_delete[] = { &s_wxluatag_wxIPaddress, NULL }; ! static int LUACALL wxLua_wxIPaddress_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxIPaddress_delete[1] = {{ wxLua_wxIPaddress_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxIPaddress_delete }}; ! static int LUACALL wxLua_wxIPaddress_delete(lua_State *L) ! { ! wxIPaddress * self = (wxIPaddress *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxIPaddress); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } --- 1180,1184 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxIPaddress_delete[] = { &s_wxluatag_wxIPaddress, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxIPaddress_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxIPaddress_delete }}; *************** *** 1322,1338 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxIPV4address_delete[] = { &s_wxluatag_wxIPV4address, NULL }; ! static int LUACALL wxLua_wxIPV4address_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxIPV4address_delete[1] = {{ wxLua_wxIPV4address_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxIPV4address_delete }}; ! static int LUACALL wxLua_wxIPV4address_delete(lua_State *L) ! { ! wxIPV4address * self = (wxIPV4address *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxIPV4address); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxIPV4address_constructor1[] = { &s_wxluatag_wxIPV4address, NULL }; --- 1274,1278 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxIPV4address_delete[] = { &s_wxluatag_wxIPV4address, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxIPV4address_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxIPV4address_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxIPV4address_constructor1[] = { &s_wxluatag_wxIPV4address, NULL }; *************** *** 1348,1352 **** wxIPV4address* returns = new wxIPV4address(*other); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxIPV4address, returns); --- 1288,1292 ---- wxIPV4address* returns = new wxIPV4address(*other); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxIPV4address, returns); *************** *** 1364,1368 **** wxIPV4address* returns = new wxIPV4address(); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxIPV4address, returns); --- 1304,1308 ---- wxIPV4address* returns = new wxIPV4address(); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxIPV4address, returns); *************** *** 1537,1553 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxProtocol_delete[] = { &s_wxluatag_wxProtocol, NULL }; ! static int LUACALL wxLua_wxProtocol_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxProtocol_delete[1] = {{ wxLua_wxProtocol_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxProtocol_delete }}; ! static int LUACALL wxLua_wxProtocol_delete(lua_State *L) ! { ! wxProtocol * self = (wxProtocol *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxProtocol); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } --- 1477,1481 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxProtocol_delete[] = { &s_wxluatag_wxProtocol, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxProtocol_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxProtocol_delete }}; *************** *** 1638,1654 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxHTTP_delete[] = { &s_wxluatag_wxHTTP, NULL }; ! static int LUACALL wxLua_wxHTTP_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxHTTP_delete[1] = {{ wxLua_wxHTTP_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxHTTP_delete }}; ! static int LUACALL wxLua_wxHTTP_delete(lua_State *L) ! { ! wxHTTP * self = (wxHTTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxHTTP); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static int LUACALL wxLua_wxHTTP_constructor(lua_State *L); --- 1566,1570 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxHTTP_delete[] = { &s_wxluatag_wxHTTP, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxHTTP_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxHTTP_delete }}; static int LUACALL wxLua_wxHTTP_constructor(lua_State *L); *************** *** 1661,1665 **** wxHTTP* returns = new wxHTTP(); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxHTTP, returns); --- 1577,1581 ---- wxHTTP* returns = new wxHTTP(); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxHTTP, returns); *************** *** 2034,2050 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxFTP_delete[] = { &s_wxluatag_wxFTP, NULL }; ! static int LUACALL wxLua_wxFTP_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxFTP_delete[1] = {{ wxLua_wxFTP_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxFTP_delete }}; ! static int LUACALL wxLua_wxFTP_delete(lua_State *L) ! { ! wxFTP * self = (wxFTP *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFTP); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static int LUACALL wxLua_wxFTP_constructor(lua_State *L); --- 1950,1954 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxFTP_delete[] = { &s_wxluatag_wxFTP, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxFTP_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxFTP_delete }}; static int LUACALL wxLua_wxFTP_constructor(lua_State *L); *************** *** 2057,2061 **** wxFTP* returns = new wxFTP(); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxFTP, returns); --- 1961,1965 ---- wxFTP* returns = new wxFTP(); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxFTP, returns); *************** *** 2503,2519 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxURI_delete[] = { &s_wxluatag_wxURI, NULL }; ! static int LUACALL wxLua_wxURI_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxURI_delete[1] = {{ wxLua_wxURI_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxURI_delete }}; ! static int LUACALL wxLua_wxURI_delete(lua_State *L) ! { ! wxURI * self = (wxURI *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxURI); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxURI_op_eq[] = { &s_wxluatag_wxURI, &s_wxluatag_wxURI, NULL }; --- 2407,2411 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxURI_delete[] = { &s_wxluatag_wxURI, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxURI_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxURI_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxURI_op_eq[] = { &s_wxluatag_wxURI, &s_wxluatag_wxURI, NULL }; *************** *** 2566,2570 **** wxURI* returns = new wxURI(*uri); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxURI, returns); --- 2458,2462 ---- wxURI* returns = new wxURI(*uri); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxURI, returns); *************** *** 2585,2589 **** wxURI* returns = new wxURI(uri); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxURI, returns); --- 2477,2481 ---- wxURI* returns = new wxURI(uri); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxURI, returns); *************** *** 2601,2605 **** wxURI* returns = new wxURI(); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxURI, returns); --- 2493,2497 ---- wxURI* returns = new wxURI(); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxURI, returns); *************** *** 2786,2802 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxURL_delete[] = { &s_wxluatag_wxURL, NULL }; ! static int LUACALL wxLua_wxURL_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxURL_delete[1] = {{ wxLua_wxURL_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxURL_delete }}; ! static int LUACALL wxLua_wxURL_delete(lua_State *L) ! { ! wxURL * self = (wxURL *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxURL); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } --- 2678,2682 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxURL_delete[] = { &s_wxluatag_wxURL, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxURL_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxURL_delete }}; *************** *** 2814,2818 **** wxURL* returns = new wxURL(*url); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxURL, returns); --- 2694,2698 ---- wxURL* returns = new wxURL(*url); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxURL, returns); *************** *** 2835,2839 **** wxURL* returns = new wxURL(sUrl); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxURL, returns); --- 2715,2719 ---- wxURL* returns = new wxURL(sUrl); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxURL, returns); Index: wxstc_stc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxstc_stc.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** wxstc_stc.cpp 10 Dec 2007 05:39:08 -0000 1.7 --- wxstc_stc.cpp 13 Dec 2007 00:47:51 -0000 1.8 *************** *** 1551,1555 **** wxColour* returns = new wxColour(self->GetCaretForeground()); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxColour*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); --- 1551,1555 ---- wxColour* returns = new wxColour(self->GetCaretForeground()); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (wxColour*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); *************** *** 1573,1577 **** wxColour* returns = new wxColour(self->GetCaretLineBack()); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxColour*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); --- 1573,1577 ---- wxColour* returns = new wxColour(self->GetCaretLineBack()); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (wxColour*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); *************** *** 1595,1599 **** wxColour* returns = new wxColour(self->GetCaretLineBackground()); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxColour*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); --- 1595,1599 ---- wxColour* returns = new wxColour(self->GetCaretLineBackground()); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (wxColour*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); *************** *** 1834,1838 **** wxColour* returns = new wxColour(self->GetEdgeColour()); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxColour*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); --- 1834,1838 ---- wxColour* returns = new wxColour(self->GetEdgeColour()); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (wxColour*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); *************** *** 3338,3342 **** wxColour* returns = new wxColour(self->IndicatorGetForeground(indic)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxColour*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); --- 3338,3342 ---- wxColour* returns = new wxColour(self->IndicatorGetForeground(indic)); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (wxColour*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); *************** *** 4304,4308 **** wxPoint* returns = new wxPoint(self->PointFromPosition(pos)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxPoint((wxPoint*)returns)); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxPoint, returns); --- 4304,4308 ---- wxPoint* returns = new wxPoint(self->PointFromPosition(pos)); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxPoint((wxPoint*)returns)); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxPoint, returns); *************** *** 8664,8680 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextEvent_delete[] = { &s_wxluatag_wxStyledTextEvent, NULL }; ! static int LUACALL wxLua_wxStyledTextEvent_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextEvent_delete[1] = {{ wxLua_wxStyledTextEvent_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxStyledTextEvent_delete }}; ! static int LUACALL wxLua_wxStyledTextEvent_delete(lua_State *L) ! { ! wxStyledTextEvent * self = (wxStyledTextEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxStyledTextEvent); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextEvent_constructor[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, NULL }; --- 8664,8668 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextEvent_delete[] = { &s_wxluatag_wxStyledTextEvent, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxStyledTextEvent_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxStyledTextEvent_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxStyledTextEvent_constructor[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, NULL }; *************** *** 8694,8698 **** wxStyledTextEvent* returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxStyledTextEvent, returns); --- 8682,8686 ---- wxStyledTextEvent* returns = new wxStyledTextEvent(commandType, id); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxStyledTextEvent, returns); Index: wxxrc_xrc.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxxrc_xrc.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxxrc_xrc.cpp 10 Dec 2007 05:39:09 -0000 1.6 --- wxxrc_xrc.cpp 13 Dec 2007 00:47:51 -0000 1.7 *************** *** 204,208 **** wxBitmap* returns = new wxBitmap(self->LoadBitmap(name)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxBitmap*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxBitmap, returns); --- 204,208 ---- wxBitmap* returns = new wxBitmap(self->LoadBitmap(name)); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (wxBitmap*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxBitmap, returns); *************** *** 298,302 **** wxIcon* returns = new wxIcon(self->LoadIcon(name)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxIcon*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxIcon, returns); --- 298,302 ---- wxIcon* returns = new wxIcon(self->LoadIcon(name)); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (wxIcon*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxIcon, returns); *************** *** 440,447 **** // wxXmlResource res wxXmlResource * res = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); ! if (wxluaO_istrackedobject(L, res)) wxluaO_removetrackedobject(L, res, wxLUA_UNDELETE_OBJECT); // call Set wxXmlResource* returns = (wxXmlResource*)wxXmlResource::Set(res); ! if (!wxluaO_istrackedobject(L, returns)) wxluaO_addtrackedobject(L, returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); --- 440,447 ---- // wxXmlResource res wxXmlResource * res = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); ! if (wxluaO_isgcobject(L, res)) wxluaO_deletegcobject(L, res, wxLUA_UNDELETE_OBJECT); // call Set wxXmlResource* returns = (wxXmlResource*)wxXmlResource::Set(res); ! if (!wxluaO_isgcobject(L, returns)) wxluaO_addgcobject(L, returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); *************** *** 501,517 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlResource_delete[] = { &s_wxluatag_wxXmlResource, NULL }; ! static int LUACALL wxLua_wxXmlResource_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlResource_delete[1] = {{ wxLua_wxXmlResource_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxXmlResource_delete }}; ! static int LUACALL wxLua_wxXmlResource_delete(lua_State *L) ! { ! wxXmlResource * self = (wxXmlResource *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxXmlResource); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlResource_constructor1[] = { &s_wxluaarg_String, &s_wxluaarg_Number, &s_wxluaarg_String, NULL }; --- 501,505 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlResource_delete[] = { &s_wxluatag_wxXmlResource, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxXmlResource_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxXmlResource_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxXmlResource_constructor1[] = { &s_wxluaarg_String, &s_wxluaarg_Number, &s_wxluaarg_String, NULL }; *************** *** 533,537 **** wxXmlResource* returns = new wxXmlResource(filemask, flags, domain); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); --- 521,525 ---- wxXmlResource* returns = new wxXmlResource(filemask, flags, domain); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); *************** *** 556,560 **** wxXmlResource* returns = new wxXmlResource(flags, domain); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); --- 544,548 ---- wxXmlResource* returns = new wxXmlResource(flags, domain); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxXmlResource, returns); Index: wxcore_core.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_core.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxcore_core.cpp 10 Dec 2007 05:39:07 -0000 1.6 --- wxcore_core.cpp 13 Dec 2007 00:47:49 -0000 1.7 *************** *** 36,52 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxLogGui_delete[] = { &s_wxluatag_wxLogGui, NULL }; ! static int LUACALL wxLua_wxLogGui_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxLogGui_delete[1] = {{ wxLua_wxLogGui_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxLogGui_delete }}; ! static int LUACALL wxLua_wxLogGui_delete(lua_State *L) ! { ! wxLogGui * self = (wxLogGui *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogGui); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static int LUACALL wxLua_wxLogGui_constructor(lua_State *L); --- 36,40 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxLogGui_delete[] = { &s_wxluatag_wxLogGui, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxLogGui_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxLogGui_delete }}; static int LUACALL wxLua_wxLogGui_constructor(lua_State *L); *************** *** 59,63 **** wxLogGui* returns = new wxLogGui(); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxLogGui((wxLogGui*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxLogGui, returns); --- 47,51 ---- wxLogGui* returns = new wxLogGui(); // add to tracked memory list ! wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxLogGui((wxLogGui*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxLogGui, returns); *************** *** 91,107 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxLogTextCtrl_delete[] = { &s_wxluatag_wxLogTextCtrl, NULL }; ! static int LUACALL wxLua_wxLogTextCtrl_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxLogTextCtrl_delete[1] = {{ wxLua_wxLogTextCtrl_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxLogTextCtrl_delete }}; ! static int LUACALL wxLua_wxLogTextCtrl_delete(lua_State *L) ! { ! wxLogTextCtrl * self = (wxLogTextCtrl *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogTextCtrl); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } --- 79,83 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxLogTextCtrl_delete[] = { &s_wxluatag_wxLogTextCtrl, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxLogTextCtrl_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxLogTextCtrl_delete }}; *************** *** 119,123 **** wxLogTextCtrl* returns = new wxLogTextCtrl(textCtrl); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxLogTextCtrl((wxLogTextCtrl*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxLogTextCtrl, returns); --- 95,99 ---- wxLogTextCtrl* returns = new wxLogTextCtrl(textCtrl); // add to tracked memory list ! wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxLogTextCtrl((wxLogTextCtrl*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxLogTextCtrl, returns); *************** *** 192,208 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxLogWindow_delete[] = { &s_wxluatag_wxLogWindow, NULL }; ! static int LUACALL wxLua_wxLogWindow_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxLogWindow_delete[1] = {{ wxLua_wxLogWindow_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxLogWindow_delete }}; ! static int LUACALL wxLua_wxLogWindow_delete(lua_State *L) ! { ! wxLogWindow * self = (wxLogWindow *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxLogWindow); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxLogWindow_constructor[] = { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, NULL }; --- 168,172 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxLogWindow_delete[] = { &s_wxluatag_wxLogWindow, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxLogWindow_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxLogWindow_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxLogWindow_constructor[] = { &s_wxluatag_wxWindow, &s_wxluaarg_String, &s_wxluaarg_Boolean, &s_wxluaarg_Boolean, NULL }; *************** *** 226,230 **** wxLogWindow* returns = new wxLogWindow(pParent, szTitle, bShow, bPassToOld); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxLogWindow((wxLogWindow*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxLogWindow, returns); --- 190,194 ---- wxLogWindow* returns = new wxLogWindow(pParent, szTitle, bShow, bPassToOld); // add to tracked memory list ! wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxLogWindow((wxLogWindow*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxLogWindow, returns); *************** *** 275,279 **** wxColour* returns = new wxColour(wxSystemSettings::GetColour(index)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxColour*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); --- 239,243 ---- wxColour* returns = new wxColour(wxSystemSettings::GetColour(index)); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (wxColour*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxColour, returns); *************** *** 297,301 **** wxFont* returns = new wxFont(wxSystemSettings::GetFont(index)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (wxFont*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxFont, returns); --- 261,265 ---- wxFont* returns = new wxFont(wxSystemSettings::GetFont(index)); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (wxFont*)returns); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxFont, returns); *************** *** 647,663 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxTextValidator_delete[] = { &s_wxluatag_wxTextValidator, NULL }; ! static int LUACALL wxLua_wxTextValidator_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxTextValidator_delete[1] = {{ wxLua_wxTextValidator_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxTextValidator_delete }}; ! static int LUACALL wxLua_wxTextValidator_delete(lua_State *L) ! { ! wxTextValidator * self = (wxTextValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxTextValidator); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxTextValidator_constructor[] = { &s_wxluaarg_Number, &s_wxluatag_wxLuaObject, NULL }; --- 611,615 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxTextValidator_delete[] = { &s_wxluatag_wxTextValidator, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxTextValidator_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxTextValidator_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxTextValidator_constructor[] = { &s_wxluaarg_Number, &s_wxluatag_wxLuaObject, NULL }; *************** *** 730,746 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxGenericValidator_delete[] = { &s_wxluatag_wxGenericValidator, NULL }; ! static int LUACALL wxLua_wxGenericValidator_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxGenericValidator_delete[1] = {{ wxLua_wxGenericValidator_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxGenericValidator_delete }}; ! static int LUACALL wxLua_wxGenericValidator_delete(lua_State *L) ! { ! wxGenericValidator * self = (wxGenericValidator *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxGenericValidator); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxGenericValidatorArrayInt_constructor[] = { &s_wxluatag_wxLuaObject, NULL }; --- 682,686 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxGenericValidator_delete[] = { &s_wxluatag_wxGenericValidator, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxGenericValidator_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxGenericValidator_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxGenericValidatorArrayInt_constructor[] = { &s_wxluatag_wxLuaObject, NULL }; *************** *** 758,762 **** wxGenericValidator *returns = new wxGenericValidator(valPtr->GetArrayPtr()); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxGenericValidator, returns); --- 698,702 ---- wxGenericValidator *returns = new wxGenericValidator(valPtr->GetArrayPtr()); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxGenericValidator, returns); *************** *** 780,784 **** wxGenericValidator *returns = new wxGenericValidator(boolPtr->GetBoolPtr()); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxGenericValidator, returns); --- 720,724 ---- wxGenericValidator *returns = new wxGenericValidator(boolPtr->GetBoolPtr()); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxGenericValidator, returns); *************** *** 802,806 **** wxGenericValidator *returns = new wxGenericValidator(valPtr->GetIntPtr()); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxGenericValidator, returns); --- 742,746 ---- wxGenericValidator *returns = new wxGenericValidator(valPtr->GetIntPtr()); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxGenericValidator, returns); *************** *** 824,828 **** wxGenericValidator *returns = new wxGenericValidator(valPtr->GetStringPtr()); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxGenericValidator, returns); --- 764,768 ---- wxGenericValidator *returns = new wxGenericValidator(valPtr->GetStringPtr()); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxGenericValidator, returns); Index: wxcore_clipdrag.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxbind/src/wxcore_clipdrag.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** wxcore_clipdrag.cpp 10 Dec 2007 05:39:07 -0000 1.6 --- wxcore_clipdrag.cpp 13 Dec 2007 00:47:49 -0000 1.7 *************** *** 44,48 **** // wxDataObject data wxDataObject * data = (wxDataObject *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxDataObject); ! if (wxluaO_istrackedobject(L, data)) wxluaO_removetrackedobject(L, data, wxLUA_UNDELETE_OBJECT); // get this wxClipboard * self = (wxClipboard *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxClipboard); --- 44,48 ---- // wxDataObject data wxDataObject * data = (wxDataObject *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxDataObject); ! if (wxluaO_isgcobject(L, data)) wxluaO_deletegcobject(L, data, wxLUA_UNDELETE_OBJECT); // get this wxClipboard * self = (wxClipboard *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxClipboard); *************** *** 203,207 **** // wxDataObject data wxDataObject * data = (wxDataObject *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxDataObject); ! if (wxluaO_istrackedobject(L, data)) wxluaO_removetrackedobject(L, data, wxLUA_UNDELETE_OBJECT); // get this wxClipboard * self = (wxClipboard *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxClipboard); --- 203,207 ---- // wxDataObject data wxDataObject * data = (wxDataObject *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxDataObject); ! if (wxluaO_isgcobject(L, data)) wxluaO_deletegcobject(L, data, wxLUA_UNDELETE_OBJECT); // get this wxClipboard * self = (wxClipboard *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxClipboard); *************** *** 286,302 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxClipboardTextEvent_delete[] = { &s_wxluatag_wxClipboardTextEvent, NULL }; ! static int LUACALL wxLua_wxClipboardTextEvent_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxClipboardTextEvent_delete[1] = {{ wxLua_wxClipboardTextEvent_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxClipboardTextEvent_delete }}; ! static int LUACALL wxLua_wxClipboardTextEvent_delete(lua_State *L) ! { ! wxClipboardTextEvent * self = (wxClipboardTextEvent *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxClipboardTextEvent); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxClipboardTextEvent_constructor[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, NULL }; --- 286,290 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxClipboardTextEvent_delete[] = { &s_wxluatag_wxClipboardTextEvent, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxClipboardTextEvent_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxClipboardTextEvent_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxClipboardTextEvent_constructor[] = { &s_wxluaarg_Number, &s_wxluaarg_Number, NULL }; *************** *** 316,320 **** wxClipboardTextEvent* returns = new wxClipboardTextEvent(type, winid); // add to tracked memory list ! wxluaO_addtrackedobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxClipboardTextEvent, returns); --- 304,308 ---- wxClipboardTextEvent* returns = new wxClipboardTextEvent(type, winid); // add to tracked memory list ! wxluaO_addgcobject(L, returns); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxClipboardTextEvent, returns); *************** *** 412,428 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxDataFormat_delete[] = { &s_wxluatag_wxDataFormat, NULL }; ! static int LUACALL wxLua_wxDataFormat_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxDataFormat_delete[1] = {{ wxLua_wxDataFormat_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxDataFormat_delete }}; ! static int LUACALL wxLua_wxDataFormat_delete(lua_State *L) ! { ! wxDataFormat * self = (wxDataFormat *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDataFormat); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxDataFormat_op_eq[] = { &s_wxluatag_wxDataFormat, &s_wxluatag_wxDataFormat, NULL }; --- 400,404 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxDataFormat_delete[] = { &s_wxluatag_wxDataFormat, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxDataFormat_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxDataFormat_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxDataFormat_op_eq[] = { &s_wxluatag_wxDataFormat, &s_wxluatag_wxDataFormat, NULL }; *************** *** 456,460 **** wxDataFormat* returns = new wxDataFormat(format); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxDataFormat((wxDataFormat*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxDataFormat, returns); --- 432,436 ---- wxDataFormat* returns = new wxDataFormat(format); // add to tracked memory list ! wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxDataFormat((wxDataFormat*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxDataFormat, returns); *************** *** 477,481 **** wxDataFormat* returns = new wxDataFormat(format); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxDataFormat((wxDataFormat*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxDataFormat, returns); --- 453,457 ---- wxDataFormat* returns = new wxDataFormat(format); // add to tracked memory list ! wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxDataFormat((wxDataFormat*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxDataFormat, returns); *************** *** 664,668 **** wxDataFormat* returns = new wxDataFormat(self->GetPreferredFormat(dir)); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxDataFormat((wxDataFormat*)returns)); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxDataFormat, returns); --- 640,644 ---- wxDataFormat* returns = new wxDataFormat(self->GetPreferredFormat(dir)); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxDataFormat((wxDataFormat*)returns)); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxDataFormat, returns); *************** *** 835,851 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxDataObjectSimple_delete[] = { &s_wxluatag_wxDataObjectSimple, NULL }; ! static int LUACALL wxLua_wxDataObjectSimple_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxDataObjectSimple_delete[1] = {{ wxLua_wxDataObjectSimple_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxDataObjectSimple_delete }}; ! static int LUACALL wxLua_wxDataObjectSimple_delete(lua_State *L) ! { ! wxDataObjectSimple * self = (wxDataObjectSimple *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDataObjectSimple); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static wxLuaArgTag s_wxluatagArray_wxLua_wxDataObjectSimple_constructor[] = { &s_wxluatag_wxDataFormat, NULL }; --- 811,815 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxDataObjectSimple_delete[] = { &s_wxluatag_wxDataObjectSimple, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxDataObjectSimple_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxDataObjectSimple_delete }}; static wxLuaArgTag s_wxluatagArray_wxLua_wxDataObjectSimple_constructor[] = { &s_wxluatag_wxDataFormat, NULL }; *************** *** 863,867 **** wxDataObjectSimple* returns = new wxDataObjectSimple(*format); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxDataObjectSimple((wxDataObjectSimple*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxDataObjectSimple, returns); --- 827,831 ---- wxDataObjectSimple* returns = new wxDataObjectSimple(*format); // add to tracked memory list ! wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxDataObjectSimple((wxDataObjectSimple*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxDataObjectSimple, returns); *************** *** 911,915 **** // wxDataObjectSimple dataObject wxDataObjectSimple * dataObject = (wxDataObjectSimple *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxDataObjectSimple); ! if (wxluaO_istrackedobject(L, dataObject)) wxluaO_removetrackedobject(L, dataObject, wxLUA_UNDELETE_OBJECT); // get this wxDataObjectComposite * self = (wxDataObjectComposite *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDataObjectComposite); --- 875,879 ---- // wxDataObjectSimple dataObject wxDataObjectSimple * dataObject = (wxDataObjectSimple *)wxluaT_getuserdatatype(L, 2, s_wxluatag_wxDataObjectSimple); ! if (wxluaO_isgcobject(L, dataObject)) wxluaO_deletegcobject(L, dataObject, wxLUA_UNDELETE_OBJECT); // get this wxDataObjectComposite * self = (wxDataObjectComposite *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDataObjectComposite); *************** *** 934,938 **** wxDataFormat* returns = new wxDataFormat(self->GetReceivedFormat()); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxDataFormat((wxDataFormat*)returns)); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxDataFormat, returns); --- 898,902 ---- wxDataFormat* returns = new wxDataFormat(self->GetReceivedFormat()); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxDataFormat((wxDataFormat*)returns)); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxDataFormat, returns); *************** *** 944,960 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxDataObjectComposite_delete[] = { &s_wxluatag_wxDataObjectComposite, NULL }; ! static int LUACALL wxLua_wxDataObjectComposite_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxDataObjectComposite_delete[1] = {{ wxLua_wxDataObjectComposite_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxDataObjectComposite_delete }}; ! static int LUACALL wxLua_wxDataObjectComposite_delete(lua_State *L) ! { ! wxDataObjectComposite * self = (wxDataObjectComposite *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxDataObjectComposite); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static int LUACALL wxLua_wxDataObjectComposite_constructor(lua_State *L); --- 908,912 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxDataObjectComposite_delete[] = { &s_wxluatag_wxDataObjectComposite, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxDataObjectComposite_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxDataObjectComposite_delete }}; static int LUACALL wxLua_wxDataObjectComposite_constructor(lua_State *L); *************** *** 967,971 **** wxDataObjectComposite* returns = new wxDataObjectComposite(); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxDataObjectComposite((wxDataObjectComposite*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxDataObjectComposite, returns); --- 919,923 ---- wxDataObjectComposite* returns = new wxDataObjectComposite(); // add to tracked memory list ! wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxDataObjectComposite((wxDataObjectComposite*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxDataObjectComposite, returns); *************** *** 1034,1038 **** wxArrayString* returns = new wxArrayString(self->GetFilenames()); // add the new object to the tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxArrayString((wxArrayString*)returns)); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxArrayString, returns); --- 986,990 ---- wxArrayString* returns = new wxArrayString(self->GetFilenames()); // add the new object to the tracked memory list ! wxluaO_addgcobject(L, (void*)returns, new wxLua_wxObject_wxArrayString((wxArrayString*)returns)); // push the result datatype wxluaT_pushuserdatatype(L, s_wxluatag_wxArrayString, returns); *************** *** 1044,1060 **** static wxLuaArgTag s_wxluatagArray_wxLua_wxFileDataObject_delete[] = { &s_wxluatag_wxFileDataObject, NULL }; ! static int LUACALL wxLua_wxFileDataObject_delete(lua_State *L); ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileDataObject_delete[1] = {{ wxLua_wxFileDataObject_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxFileDataObject_delete }}; ! static int LUACALL wxLua_wxFileDataObject_delete(lua_State *L) ! { ! wxFileDataObject * self = (wxFileDataObject *)wxluaT_getuserdatatype(L, 1, s_wxluatag_wxFileDataObject); ! // if removed from tracked mem list, reset the tag so that gc() is not called on this object. ! if ((self != NULL) && wxluaO_removetrackedobject(L, self, wxLUA_DELETE_CLEAR_OBJECT)) ! { ! lua_pushnil(L); ! lua_setmetatable(L, -2); ! } ! return 0; ! } static int LUACALL wxLua_wxFileDataObject_constructor(lua_State *L); --- 996,1000 ---- static wxLuaArgTag s_wxluatagArray_wxLua_wxFileDataObject_delete[] = { &s_wxluatag_wxFileDataObject, NULL }; ! static wxLuaBindCFunc s_wxluafunc_wxLua_wxFileDataObject_delete[1] = {{ wxLua_wxluabind_delete, WXLUAMETHOD_METHOD|WXLUAMETHOD_DELETE, 1, 1, s_wxluatagArray_wxLua_wxFileDataObject_delete }}; static int LUACALL wxLua_wxFileDataObject_constructor(lua_State *L); *************** *** 1067,1071 **** wxFileDataObject* returns = new wxFileDataObject(); // add to tracked memory list ! wxluaO_addtrackedobject(L, (void*)returns, new wxLua_wxObject_wxFileDataObject((wxFileDataObject*)returns)); // push the constructed class pointer wxluaT_pushuserdatatype(L, s_wxluatag_wxFileDataObject, returns); --- 1007,1011 ---- wxFileDataObject* returns = new wxFileDataObject(); // add to tracked memory list ! wxluaO_addgcobject(L, (void*)retu... [truncated message content] |