From: John L. <jr...@us...> - 2007-07-22 04:38:35
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv12109/wxLua/modules/wxlua/include Modified Files: wxldefs.h wxlstate.h wxlua_bind.h Log Message: Add parameter to wxLuaState::RemoveTrackedObject to select how we untrack it Fixes removing derived methods for the %ungc binding tag Index: wxldefs.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxldefs.h,v retrieving revision 1.29 retrieving revision 1.30 diff -C2 -d -r1.29 -r1.30 *** wxldefs.h 16 Jul 2007 19:35:30 -0000 1.29 --- wxldefs.h 22 Jul 2007 04:38:29 -0000 1.30 *************** *** 67,71 **** //----------------------------------------------------------------------------- ! #define WXLUA_BINDING_VERSION 15 // ---------------------------------------------------------------------------- --- 67,71 ---- //----------------------------------------------------------------------------- ! #define WXLUA_BINDING_VERSION 16 // ---------------------------------------------------------------------------- Index: wxlstate.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlstate.h,v retrieving revision 1.86 retrieving revision 1.87 diff -C2 -d -r1.86 -r1.87 *** wxlstate.h 19 Jul 2007 03:09:46 -0000 1.86 --- wxlstate.h 22 Jul 2007 04:38:29 -0000 1.87 *************** *** 170,175 **** // Push the object u onto the top of the stack wrapped in a newuserdata // with it's metatable set to the table from tget(tag). Returns true if the ! // tag is known and the metatable was set. WXDLLIMPEXP_WXLUA bool LUACALL wxlua_tpushusertag(lua_State* L, const void* u, int tag, bool track); // Get the numeric tag of the object at the stack index using the metatable's "tag" key. // returns WXLUA_NOTAG if the metatable of the object doesn't have a "tag" --- 170,182 ---- // Push the object u onto the top of the stack wrapped in a newuserdata // with it's metatable set to the table from tget(tag). Returns true if the ! // tag is known and the metatable was set. If track=true then push the ! // object as a lightuser data key into the wxlua_pushkey_wxLuaObjects table of ! // the Lua registry so that if we need to push it again we just push the full ! // userdata value. WXDLLIMPEXP_WXLUA bool LUACALL wxlua_tpushusertag(lua_State* L, const void* u, int tag, bool track); + // If an object was pushed into Lua using wxlua_tpushusertag with track=true + // then this function will remove the object from being tracked in the + // wxlua_pushkey_wxLuaObjects Lua registry table. + WXDLLIMPEXP_WXLUA void LUACALL wxlua_tuntrackuserdata(lua_State* L, const void* u); // Get the numeric tag of the object at the stack index using the metatable's "tag" key. // returns WXLUA_NOTAG if the metatable of the object doesn't have a "tag" *************** *** 612,615 **** --- 619,630 ---- // memory tracking functions (internal use) + enum RemoveTrackedObject_flags + { + UNDELETE = 0, // stop tracking for deletion (someone else owns this) + DELETE_OBJECT = 0x0001, // delete the object + CLEAR_LUA_TRACKED = 0x0002, // clear tracking the object in lua reg table + CLEAR_DERIVED_METHODS = 0x0004 // clear any derived methods in the lua reg table + }; + // Track this object and delete it when lua calls the gc method for it void AddTrackedObject(wxObject *pObject); *************** *** 618,623 **** // This is used for encapsulated classes that are wrapped in a wxObject. void AddTrackedObject(long obj_ptr, wxObject *pObject); ! // Remove the object from the tracked memory and if fDelete, delete it too. ! bool RemoveTrackedObject(void *pObject, bool fDelete = true); // Is this object currently tracked? bool IsTrackedObject(void *pObject) const; --- 633,639 ---- // This is used for encapsulated classes that are wrapped in a wxObject. void AddTrackedObject(long obj_ptr, wxObject *pObject); ! // Remove the object from the tracked memory. ! // flags are ored values of enum RemoveTrackedObject_flags ! bool RemoveTrackedObject(void *pObject, int flags); // Is this object currently tracked? bool IsTrackedObject(void *pObject) const; Index: wxlua_bind.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlua_bind.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxlua_bind.h 16 Jul 2007 19:35:30 -0000 1.3 --- wxlua_bind.h 22 Jul 2007 04:38:29 -0000 1.4 *************** *** 17,23 **** // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 15 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 15 // --------------------------------------------------------------------------- --- 17,23 ---- // the current version of the bindings. // See 'bindings/genwxbind.lua' and 'modules/wxlua/include/wxldefs.h' ! #if WXLUA_BINDING_VERSION > 16 # error "The WXLUA_BINDING_VERSION in the bindings is too old, regenerate bindings." ! #endif //WXLUA_BINDING_VERSION > 16 // --------------------------------------------------------------------------- |