diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 86b87c16cb..34dbcf0089 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -370,6 +370,9 @@ bool wxAppConsoleBase::ProcessIdle() wxLog::FlushActive(); #endif + // Garbage collect all objects previously scheduled for destruction. + DeletePendingObjects(); + return event.MoreRequested(); } @@ -509,9 +512,6 @@ void wxAppConsoleBase::ProcessPendingEvents() wxLEAVE_CRIT_SECT(m_handlersWithPendingEventsLocker); } - - // Garbage collect all objects previously scheduled for destruction. - DeletePendingObjects(); } void wxAppConsoleBase::DeletePendingEvents() diff --git a/src/common/evtloopcmn.cpp b/src/common/evtloopcmn.cpp index 300a1885d1..aa1aca9cbc 100644 --- a/src/common/evtloopcmn.cpp +++ b/src/common/evtloopcmn.cpp @@ -139,7 +139,7 @@ int wxEventLoopManual::Run() // generate and process idle events for as long as we don't // have anything else to do - while ( !Pending() && ProcessIdle() ) + while ( !Pending() && ProcessIdle() && !m_shouldExit ) ; // if the "should exit" flag is set, the loop should terminate