From: Vadim Zeitlin Date: Wed, 27 Feb 2008 17:54:44 +0000 (+0000) Subject: don't track handlers connected to this object itself (patch 1899730) X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/886274c6f978fbee05e34e9dd341507a554211f3 don't track handlers connected to this object itself (patch 1899730) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52150 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/event.cpp b/src/common/event.cpp index 6ba5895089..da4b8066bc 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -1376,7 +1376,7 @@ void wxEvtHandler::Connect( int id, int lastId, #if wxUSE_WEAKREF // Make sure we get to know when a sink is destroyed - if ( eventSink ) + if ( eventSink && eventSink != this ) { wxEventConnectionRef *evtConnRef = FindRefInTrackerList(eventSink); if ( evtConnRef ) @@ -1397,7 +1397,7 @@ bool wxEvtHandler::Disconnect( int id, int lastId, wxEventType eventType, #if wxUSE_WEAKREF // Remove connection from tracker node (wxEventConnectionRef) - if ( eventSink ) + if ( eventSink && eventSink != this ) { wxEventConnectionRef *evtConnRef = FindRefInTrackerList(eventSink); if ( evtConnRef )