Update of /cvsroot/wxlua/wxLua/bindings
In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv11381/wxLua/bindings
Modified Files:
genwxbind.lua
Log Message:
Second try at really allowing pushing the same object, but with different tags
by tracking the userdata and have it fully clean up after itself.
Index: genwxbind.lua
===================================================================
RCS file: /cvsroot/wxlua/wxLua/bindings/genwxbind.lua,v
retrieving revision 1.154
retrieving revision 1.155
diff -C2 -d -r1.154 -r1.155
*** genwxbind.lua 13 Dec 2007 00:47:47 -0000 1.154
--- genwxbind.lua 13 Dec 2007 06:23:53 -0000 1.155
***************
*** 3254,3258 ****
end
elseif param.UnGC then
! table.insert(gcList, " if (wxluaO_isgcobject(L, "..argName..")) wxluaO_deletegcobject(L, "..argName..", wxLUA_UNDELETE_OBJECT);\n")
end
--- 3254,3258 ----
end
elseif param.UnGC then
! table.insert(gcList, " if (wxluaO_isgcobject(L, "..argName..")) wxluaO_undeletegcobject(L, "..argName..");\n")
end
***************
*** 3591,3595 ****
if parseObject["%ungc_this"] then
! table.insert(codeList, " wxluaO_deletegcobject(L, self, wxLUA_UNDELETE_OBJECT);\n")
elseif parseObject["%gc_this"] then
if parseObject["%encapsulate"] then
--- 3591,3595 ----
if parseObject["%ungc_this"] then
! table.insert(codeList, " wxluaO_undeletegcobject(L, self);\n")
elseif parseObject["%gc_this"] then
if parseObject["%encapsulate"] then
***************
*** 3671,3675 ****
end
elseif member.UnGC then
! table.insert(codeList, " if (wxluaO_isgcobject(L, returns)) wxluaO_deletegcobject(L, returns, wxLUA_UNDELETE_OBJECT);\n")
end
--- 3671,3675 ----
end
elseif member.UnGC then
! table.insert(codeList, " if (wxluaO_isgcobject(L, returns)) wxluaO_undeletegcobject(L, returns);\n")
end
***************
*** 3828,3846 ****
local funcName_ = funcName
! if false then
! table.insert(codeList, "static int LUACALL "..funcName.."(lua_State *L)\n{\n")
! table.insert(codeList, " return wxLua_wxlua_delete(L);\n")
! --[[
! table.insert(codeList, " "..parseObject.Name.." * self = ("..parseObject.Name.." *)wxluaT_getuserdatatype(L, 1, s_wxluatag_"..MakeClassVar(parseObject.Name)..");\n")
! CommentBindingTable(codeList, " // if removed from tracked mem list, reset the tag so that gc() is not called on this object.\n")
! table.insert(codeList, " if ((self != NULL) && wxluaO_deletegcobject(L, self, wxLUA_DELETE_REMOVE_OBJECT))\n")
! table.insert(codeList, " {\n")
! table.insert(codeList, " lua_pushnil(L);\n")
! table.insert(codeList, " lua_setmetatable(L, -2);\n")
! table.insert(codeList, " }\n")
! table.insert(codeList, " return 0;\n")
! table.insert(codeList, "}\n")
! --]]
! elseif not overrideTable[funcName] then
funcName_ = "wxLua_wxluabind_delete"
end
--- 3828,3832 ----
local funcName_ = funcName
! if not overrideTable[funcName] then
funcName_ = "wxLua_wxluabind_delete"
end
|