From: John L. <jr...@us...> - 2005-11-28 01:29:27
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17359/wxLua/modules/wxlua/include Modified Files: internal.h wxlcallb.h wxlintrp.h Log Message: use wxMemorySize in >2.6 in defsutils.i fix removing callbacks (segfault on exit) Index: wxlintrp.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlintrp.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** wxlintrp.h 26 Nov 2005 08:46:57 -0000 1.3 --- wxlintrp.h 28 Nov 2005 01:28:54 -0000 1.4 *************** *** 32,36 **** class WXDLLIMPEXP_WXLUA wxLuaEvent; - class WXDLLIMPEXP_WXLUA wxLuaStateVariables; class WXDLLIMPEXP_WXLUA wxLuaInterpreter; --- 32,35 ---- *************** *** 44,48 **** extern wxLuaInterpreter *wxFindLuaInterpreter(lua_State *L); - extern wxLuaStateVariables *wxFindLuaStateVariables(lua_State *L); //----------------------------------------------------------------------------- --- 43,46 ---- Index: wxlcallb.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/wxlcallb.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wxlcallb.h 26 Nov 2005 08:46:57 -0000 1.2 --- wxlcallb.h 28 Nov 2005 01:28:54 -0000 1.3 *************** *** 16,21 **** #include "wxlua/include/wxldefs.h" - class WXDLLIMPEXP_WXLUA wxLuaStateVariables; - // ---------------------------------------------------------------------------- // wxLuaCallback - proxy class to pass a reference to a lua function --- 16,19 ---- *************** *** 34,38 **** virtual ~wxLuaCallback(); ! void ClearState(); wxLuaState GetwxLuaState() const { return m_wxlState; } --- 32,36 ---- virtual ~wxLuaCallback(); ! void ClearLuaState() { m_wxlState.UnRef(); } wxLuaState GetwxLuaState() const { return m_wxlState; } *************** *** 48,56 **** void CallFunction(wxEvent *pEvent); ! // reference to the routine to call int m_routine; ! // store the state variables since we're added to a list of callbacks. ! // The lua_State is NULLed when the window (handler) is destroyed, ! // but we still want to remove us from the state vars callback list. wxLuaState m_wxlState; --- 46,53 ---- void CallFunction(wxEvent *pEvent); ! // reference to the lua routine to call int m_routine; ! ! // store the wxLuaState since we're added to a list of it's callbacks. wxLuaState m_wxlState; *************** *** 77,81 **** virtual ~wxLuaDestroyCallback(); ! void ClearState() { m_wxlState.UnRef(); } wxLuaState GetwxLuaState() const { return m_wxlState; } --- 74,78 ---- virtual ~wxLuaDestroyCallback(); ! void ClearLuaState() { m_wxlState.UnRef(); } wxLuaState GetwxLuaState() const { return m_wxlState; } *************** *** 90,95 **** // Lua state instance wxLuaState m_wxlState; - // store the state variables see wxLuaCallback for reasoning - wxLuaStateVariables *m_luaStateVars; wxEvtHandler *m_pHandler; int m_id; --- 87,90 ---- Index: internal.h =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/include/internal.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** internal.h 26 Nov 2005 08:46:57 -0000 1.8 --- internal.h 28 Nov 2005 01:28:54 -0000 1.9 *************** *** 36,41 **** #define wxFileWriteAppend write_append ! #define wxDataObjectGet wxDataObject::Get ! #define wxDataObjectSet wxDataObject::Set #if defined(__WXGTK__) --- 36,41 ---- #define wxFileWriteAppend write_append ! //#define wxDataObjectGet wxDataObject::Get ! //#define wxDataObjectSet wxDataObject::Set #if defined(__WXGTK__) *************** *** 113,119 **** wxLuaState wxlState(L); \ wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); \ ! if (wxlState.GetLuaStateRefData()->m_pTrackedList == NULL) { \ wxlState.GetLuaStateRefData()->m_pTrackedList = new wxHashTable(wxKEY_INTEGER); \ ! wxlState.GetLuaStateRefData()->m_pTrackedList->Put((int)p##theObject, new theObject##Object(p##theObject)); } \ } --- 113,119 ---- wxLuaState wxlState(L); \ wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); \ ! if (wxlState.GetLuaStateRefData()->m_pTrackedList == NULL) \ wxlState.GetLuaStateRefData()->m_pTrackedList = new wxHashTable(wxKEY_INTEGER); \ ! wxlState.GetLuaStateRefData()->m_pTrackedList->Put((int)p##theObject, new theObject##Object(p##theObject)); \ } *************** *** 178,182 **** private: ! wxLuaState m_wxlState; // can't declare full class int m_iReference; bool m_bool; --- 178,182 ---- private: ! wxLuaState m_wxlState; int m_iReference; bool m_bool; *************** *** 190,200 **** class wxLuaTreeItemData : public wxTreeItemData { - private: - double m_value; - public: wxLuaTreeItemData(double value = 0) : m_value(value) {} double GetValue() const { return m_value; } void SetValue(double value) { m_value = value; } }; --- 190,200 ---- class wxLuaTreeItemData : public wxTreeItemData { public: wxLuaTreeItemData(double value = 0) : m_value(value) {} double GetValue() const { return m_value; } void SetValue(double value) { m_value = value; } + + private: + double m_value; }; *************** *** 331,337 **** public: wxLuaFunction(WXLUAMETHOD *pMethod, WXLUACLASS *pClass, void *pObject) ! : m_pMethod(pMethod), ! m_pClass(pClass), ! m_pObject(pObject) { } --- 331,335 ---- public: wxLuaFunction(WXLUAMETHOD *pMethod, WXLUACLASS *pClass, void *pObject) ! : m_pMethod(pMethod), m_pClass(pClass), m_pObject(pObject) { } *************** *** 370,374 **** return wxEmptyString; ! return wxConvertMB2WX(luastr); } --- 368,372 ---- return wxEmptyString; ! return wxConvertMB2WX(luastr); // this fails on NULL } *************** *** 384,389 **** { public: ! LuaCharBuffer(const wxString &wxstr) ! : m_buffer((const char *)NULL) { wxCharBuffer charBuffer = wxConvertWX2MB(wxstr.c_str()); --- 382,386 ---- { public: ! LuaCharBuffer(const wxString &wxstr) : m_buffer((const char *)NULL) { wxCharBuffer charBuffer = wxConvertWX2MB(wxstr.c_str()); |