diff --git a/src/cocoa/evtloop.mm b/src/cocoa/evtloop.mm index add5528e94..7a6e393670 100644 --- a/src/cocoa/evtloop.mm +++ b/src/cocoa/evtloop.mm @@ -64,6 +64,8 @@ int wxEventLoop::Run() [[NSApplication sharedApplication] run]; + OnExit(); + int exitcode = m_impl->GetExitCode(); delete m_impl; m_impl = NULL; diff --git a/src/gtk/evtloop.cpp b/src/gtk/evtloop.cpp index fbdd81bd2d..11406deb0b 100644 --- a/src/gtk/evtloop.cpp +++ b/src/gtk/evtloop.cpp @@ -75,6 +75,8 @@ int wxEventLoop::Run() gtk_main(); + OnExit(); + int exitcode = m_impl->GetExitCode(); delete m_impl; m_impl = NULL; diff --git a/src/gtk1/evtloop.cpp b/src/gtk1/evtloop.cpp index b610e01a75..8f5dfb1341 100644 --- a/src/gtk1/evtloop.cpp +++ b/src/gtk1/evtloop.cpp @@ -75,6 +75,8 @@ int wxEventLoop::Run() gtk_main(); + OnExit(); + int exitcode = m_impl->GetExitCode(); delete m_impl; m_impl = NULL; diff --git a/src/mgl/evtloop.cpp b/src/mgl/evtloop.cpp index 076009f6d4..8135bf6a5d 100644 --- a/src/mgl/evtloop.cpp +++ b/src/mgl/evtloop.cpp @@ -137,6 +137,8 @@ int wxEventLoop::Run() } } + OnExit(); + int exitcode = m_impl->GetExitCode(); delete m_impl; m_impl = NULL; diff --git a/src/motif/evtloop.cpp b/src/motif/evtloop.cpp index 79a49240f1..84999bb11e 100644 --- a/src/motif/evtloop.cpp +++ b/src/motif/evtloop.cpp @@ -122,6 +122,8 @@ int wxEventLoop::Run() break; } + OnExit(); + int exitcode = m_impl->GetExitCode(); delete m_impl; m_impl = NULL; diff --git a/src/os2/evtloop.cpp b/src/os2/evtloop.cpp index 08f615fe50..e558aaefeb 100644 --- a/src/os2/evtloop.cpp +++ b/src/os2/evtloop.cpp @@ -277,6 +277,8 @@ int wxEventLoop::Run() wxMilliSleep(10); } + OnExit(); + return m_impl->GetExitCode(); } diff --git a/src/x11/evtloop.cpp b/src/x11/evtloop.cpp index b62ce72440..ce563c8499 100644 --- a/src/x11/evtloop.cpp +++ b/src/x11/evtloop.cpp @@ -372,10 +372,6 @@ int wxEventLoop::Run() m_impl->m_keepGoing = true; while ( m_impl->m_keepGoing ) { -#if 0 // wxUSE_THREADS - wxMutexGuiLeaveOrEnter(); -#endif // wxUSE_THREADS - // generate and process idle events for as long as we don't have // anything else to do while ( ! Pending() ) @@ -385,13 +381,6 @@ int wxEventLoop::Run() #endif if (!m_impl->SendIdleEvent()) { -#if 0 // wxUSE_THREADS - // leave the main loop to give other threads a chance to - // perform their GUI work - wxMutexGuiLeave(); - wxUsleep(20); - wxMutexGuiEnter(); -#endif // Break out of while loop break; } @@ -405,6 +394,8 @@ int wxEventLoop::Run() } } + OnExit(); + int exitcode = m_impl->GetExitCode(); delete m_impl; m_impl = NULL;