X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/47b6fabc7d0405bbbd3d9efd516c44f0b5b94dfc..d230488b29e48d130a8883215db18fbd92daf48c:/src/common/event.cpp?ds=inline diff --git a/src/common/event.cpp b/src/common/event.cpp index 0ba18aa5bc..6ba5895089 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -44,10 +44,13 @@ #endif #include "wx/thread.h" -#include "wx/ptr_scpd.h" -wxDECLARE_SCOPED_PTR(wxEvent, wxEventPtr) -wxDEFINE_SCOPED_PTR(wxEvent, wxEventPtr) +#if wxUSE_BASE + #include "wx/ptr_scpd.h" + + wxDECLARE_SCOPED_PTR(wxEvent, wxEventPtr) + wxDEFINE_SCOPED_PTR(wxEvent, wxEventPtr) +#endif // wxUSE_BASE // ---------------------------------------------------------------------------- // wxWin macros @@ -1057,6 +1060,7 @@ wxEvtHandler::~wxEvtHandler() { wxDynamicEventTableEntry *entry = (wxDynamicEventTableEntry*)*it; +#if wxUSE_WEAKREF // Remove ourselves from sink destructor notifications // (this has usually been been done, in wxTrackable destructor) wxEvtHandler *eventSink = entry->m_eventSink; @@ -1070,6 +1074,7 @@ wxEvtHandler::~wxEvtHandler() delete evtConnRef; } } +#endif // wxUSE_WEAKREF if (entry->m_callbackUserData) delete entry->m_callbackUserData; @@ -1369,6 +1374,7 @@ void wxEvtHandler::Connect( int id, int lastId, // Insert at the front of the list so most recent additions are found first m_dynamicEvents->Insert( (wxObject*) entry ); +#if wxUSE_WEAKREF // Make sure we get to know when a sink is destroyed if ( eventSink ) { @@ -1378,6 +1384,7 @@ void wxEvtHandler::Connect( int id, int lastId, else evtConnRef = new wxEventConnectionRef(this, eventSink); } +#endif // wxUSE_WEAKREF } bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType, @@ -1388,6 +1395,7 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType, if (!m_dynamicEvents) return false; +#if wxUSE_WEAKREF // Remove connection from tracker node (wxEventConnectionRef) if ( eventSink ) { @@ -1395,6 +1403,7 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType, if ( evtConnRef ) evtConnRef->DecRef(); } +#endif // wxUSE_WEAKREF wxList::compatibility_iterator node = m_dynamicEvents->GetFirst(); while (node) @@ -1486,6 +1495,7 @@ void *wxEvtHandler::DoGetClientData() const return m_clientData; } +#if wxUSE_WEAKREF // A helper to find an wxEventConnectionRef object wxEventConnectionRef * wxEvtHandler::FindRefInTrackerList(wxEvtHandler *eventSink) @@ -1525,6 +1535,7 @@ void wxEvtHandler::OnSinkDestroyed( wxEvtHandler *sink ) node = node_nxt; } } +#endif // wxUSE_WEAKREF #endif // wxUSE_BASE