From: John L. <jr...@us...> - 2005-11-26 09:42:35
|
Update of /cvsroot/wxlua/wxLua/modules/wxlua/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1814/wxLua/modules/wxlua/src Modified Files: internal.cpp wxlcallb.cpp wxlstate.cpp Log Message: make it compile in MSVS6 Index: internal.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/internal.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** internal.cpp 26 Nov 2005 08:46:57 -0000 1.12 --- internal.cpp 26 Nov 2005 09:42:27 -0000 1.13 *************** *** 659,663 **** wxLuaState wxlState(L); wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); ! return wxlState.addToTrackedMemoryList(pObject); } --- 659,663 ---- wxLuaState wxlState(L); wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); ! wxlState.addToTrackedMemoryList(pObject); } *************** *** 682,686 **** wxLuaState wxlState(L); wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); ! return wxlState.addToTrackedWindowList(pWindow); } --- 682,686 ---- wxLuaState wxlState(L); wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); ! wxlState.addToTrackedWindowList(pWindow); } *************** *** 701,705 **** wxLuaState wxlState(L); wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); ! return wxlState.pushuserdatatype(iTag, data); } else --- 701,705 ---- wxLuaState wxlState(L); wxCHECK_RET(wxlState.Ok(), wxT("Invalid wxLuaState")); ! wxlState.pushuserdatatype(iTag, data); } else *************** *** 1311,1314 **** --- 1311,1316 ---- // Create and connect the callback pCallback = new wxLuaCallback(wxlState, 4, id, (int) eventType, evtHandler); + wxlState.GetLuaStateRefData()->m_pAppHandlerList->Append(pCallback); // FIXME see wxCallb constructor + break; } *************** *** 1346,1349 **** --- 1348,1352 ---- // Create and connect the callback pCallback = new wxLuaCallback(wxlState, 3, id, (int) eventType, evtHandler); + wxlState.GetLuaStateRefData()->m_pAppHandlerList->Append(pCallback); // FIXME see wxCallb constructor } Index: wxlstate.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlstate.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** wxlstate.cpp 26 Nov 2005 08:46:57 -0000 1.5 --- wxlstate.cpp 26 Nov 2005 09:42:27 -0000 1.6 *************** *** 199,202 **** --- 199,212 ---- m_pWindowList = new wxList; + m_pDerivedList->DeleteContents(true); + m_pTrackedList->DeleteContents(true); + + // don't "own" pointers to wxLuaCallbacks, let wxEventHandler do it + m_pAppHandlerList->DeleteContents(false); + // don't delete wxLuaDestroyCallbacks, let wxEventHandler do it + m_pDestroyHandlerList->DeleteContents(false); + // don't delete wxWindow derived classes, let wxWidgets do it + m_pWindowList->DeleteContents(false); + // always add wxWidgets binding m_bindings.Append(new wx_Binding()); *************** *** 259,270 **** } - CleanupWxLua(!m_lua_State_static); s_wxHashMapLuaStateRefData.erase(m_lua_State); ! ! m_pDerivedList->DeleteContents(false); ! m_pTrackedList->DeleteContents(false); ! m_pWindowList->DeleteContents(false); ! ! m_lua_State = NULL; return true; --- 269,274 ---- } s_wxHashMapLuaStateRefData.erase(m_lua_State); ! CleanupWxLua(!m_lua_State_static); return true; *************** *** 277,283 **** //lua_setgcthreshold(L, luaL_optint(L, 1, 0)); // = luaB_collectgarbage(L); - m_pDerivedList->DeleteContents(true); - m_pTrackedList->DeleteContents(true); - ClearCallbacks(); --- 281,284 ---- *************** *** 286,299 **** UnRegisterBindings(); lua_close(m_lua_State); } - // don't "own" pointers to wxLuaCallbacks, let wxEventHandler do it - m_pAppHandlerList->DeleteContents(false); m_pAppHandlerList->Clear(); - // don't delete wxLuaDestroyCallbacks, let wxEventHandler do it - m_pDestroyHandlerList->DeleteContents(false); m_pDestroyHandlerList->Clear(); - // don't delete wxWindow derived classes, let wxWidgets do it - m_pWindowList->DeleteContents(false); m_pWindowList->Clear(); } --- 287,295 ---- UnRegisterBindings(); lua_close(m_lua_State); + m_lua_State = NULL; } m_pAppHandlerList->Clear(); m_pDestroyHandlerList->Clear(); m_pWindowList->Clear(); } *************** *** 327,335 **** } - // don't "own" pointers to wxLuaCallbacks, let wxEventHandler do it - m_pAppHandlerList->DeleteContents(false); m_pAppHandlerList->Clear(); - // don't delete wxLuaDestroyCallbacks, let wxEventHandler do it - m_pDestroyHandlerList->DeleteContents(false); m_pDestroyHandlerList->Clear(); } --- 323,327 ---- *************** *** 729,733 **** { M_WXLSTATEDATA->m_pWindowList->Append(pWindow); ! new wxLuaCallback(*this, 3, pWindow->GetId(), wxEVT_DESTROY, pWindow->GetEventHandler()); } } --- 721,726 ---- { M_WXLSTATEDATA->m_pWindowList->Append(pWindow); ! wxLuaCallback* pCallback = new wxLuaCallback(*this, 3, pWindow->GetId(), wxEVT_DESTROY, pWindow->GetEventHandler()); ! GetLuaStateRefData()->m_pAppHandlerList->Append(pCallback); // FIXME see wxCallb constructor } } Index: wxlcallb.cpp =================================================================== RCS file: /cvsroot/wxlua/wxLua/modules/wxlua/src/wxlcallb.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** wxlcallb.cpp 26 Nov 2005 08:46:57 -0000 1.2 --- wxlcallb.cpp 26 Nov 2005 09:42:27 -0000 1.3 *************** *** 57,61 **** //if (pEvtHandler->IsKindOf(CLASSINFO(wxApp))) { ! m_wxlState.GetLuaStateRefData()->m_pAppHandlerList->Append(this); } } --- 57,61 ---- //if (pEvtHandler->IsKindOf(CLASSINFO(wxApp))) { ! //m_wxlState.GetLuaStateRefData()->m_pAppHandlerList->Append(this); } } *************** *** 113,117 **** { // go to new node before we delete it ! node = node->GetNext(); // delete the reference to all other handlers that are cleared m_wxlState.GetLuaStateRefData()->m_pAppHandlerList->DeleteObject(pCallback); --- 113,117 ---- { // go to new node before we delete it ! node = wxlState.GetLuaStateRefData()->m_pAppHandlerList->GetFirst(); // delete the reference to all other handlers that are cleared m_wxlState.GetLuaStateRefData()->m_pAppHandlerList->DeleteObject(pCallback); |