X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/924b84ab9461c95cf5c5386d1091ae0f7a8e7ce7..c92ad09968b09fe6e4cf17d9e962b51b7caaee91:/src/common/event.cpp?ds=inline diff --git a/src/common/event.cpp b/src/common/event.cpp index 648c80e2b7..7597499232 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" @@ -1077,18 +1066,10 @@ void wxEvtHandler::ClearEventLocker() delete m_eventsLocker; m_eventsLocker = NULL; #endif -}; +} #endif // wxUSE_THREADS -#if wxUSE_EXCEPTIONS -void wxEvtHandler::DoHandleEvent(wxEventFunction func, wxEvent& event) -{ - // by default, just call then handler - (this->*func)(event); -} -#endif // wxUSE_EXCEPTIONS - void wxEvtHandler::AddPendingEvent(wxEvent& event) { // 1) Add event to list of pending events of this event handler @@ -1103,7 +1084,10 @@ void wxEvtHandler::AddPendingEvent(wxEvent& event) wxENTER_CRIT_SECT( Lock() ); if ( !m_pendingEvents ) + { m_pendingEvents = new wxList; + m_pendingEvents->DeleteContents(true); + } m_pendingEvents->Append(eventCopy); @@ -1120,7 +1104,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(); } @@ -1145,15 +1129,14 @@ void wxEvtHandler::ProcessPendingEvents() { wxEvent *event = (wxEvent *)node->GetData(); - m_pendingEvents->Erase(node); - wxLEAVE_CRIT_SECT( Lock() ); ProcessEvent(*event); - delete event; wxENTER_CRIT_SECT( Lock() ); + m_pendingEvents->Erase(node); + if ( !--n ) break; } @@ -1378,7 +1361,7 @@ bool wxEvtHandler::SearchDynamicEventTable( wxEvent& event ) } return false; -}; +} void wxEvtHandler::DoSetClientObject( wxClientData *data ) {