X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d008a4a6bbe96efc758c76db2234fb68d482667c..abb4f9c93715f5b00c526203af96ed2938a1a2c3:/src/common/event.cpp diff --git a/src/common/event.cpp b/src/common/event.cpp index 7af4275db2..8b74ef2a81 100644 --- a/src/common/event.cpp +++ b/src/common/event.cpp @@ -17,17 +17,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) && !defined(__EMX__) -// Some older compilers (such as EMX) cannot handle -// #pragma interface/implementation correctly, iff -// #pragma implementation is used in _two_ translation -// units (as created by e.g. event.cpp compiled for -// libwx_base and event.cpp compiled for libwx_gui_core). -// So we must not use those pragmas for those compilers in -// such files. - #pragma implementation "event.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -247,12 +236,6 @@ DEFINE_EVENT_TYPE(wxEVT_SCROLL_THUMBTRACK) DEFINE_EVENT_TYPE(wxEVT_SCROLL_THUMBRELEASE) DEFINE_EVENT_TYPE(wxEVT_SCROLL_CHANGED) -// see comments in wx/event.h, near wxEVT_SCROLL_ENDSCROLL declaration -#if wxCHECK_VERSION(2, 7, 0) - #error "Remove the line below, not needed any more" -#endif -const wxEventType wxEVT_SCROLL_ENDSCROLL = wxEVT_SCROLL_CHANGED; - // Scroll events from wxWindow DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_TOP) DEFINE_EVENT_TYPE(wxEVT_SCROLLWIN_BOTTOM) @@ -1040,6 +1023,8 @@ wxEvtHandler::~wxEvtHandler() delete m_dynamicEvents; }; + if (m_pendingEvents) + m_pendingEvents->DeleteContents(true); delete m_pendingEvents; #if wxUSE_THREADS @@ -1083,7 +1068,7 @@ void wxEvtHandler::ClearEventLocker() delete m_eventsLocker; m_eventsLocker = NULL; #endif -}; +} #endif // wxUSE_THREADS @@ -1118,7 +1103,7 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event) wxLEAVE_CRIT_SECT(*wxPendingEventsLocker); - // 3) Inform the system that new pending events are somwehere, + // 3) Inform the system that new pending events are somewhere, // and that these should be processed in idle time. wxWakeUpIdle(); } @@ -1143,6 +1128,9 @@ void wxEvtHandler::ProcessPendingEvents() { wxEvent *event = (wxEvent *)node->GetData(); + // It's importan we remove event from list before processing it. + // Else a nested event loop, for example from a modal dialog, might + // process the same event again. m_pendingEvents->Erase(node); wxLEAVE_CRIT_SECT( Lock() ); @@ -1376,7 +1364,7 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) } return false; -}; +} void wxEvtHandler::DoSetClientObject( wxClientData *data ) {