destroy m_impl even if an exception is thrown from the main loop

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45030 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-03-23 13:24:55 +00:00
parent 1a81eea8d4
commit 68a9527d51

View File

@@ -25,6 +25,7 @@
#endif
#include "wx/evtloop.h"
#include "wx/ptr_scpd.h"
#ifndef WX_PRECOMP
#include "wx/app.h"
@@ -55,6 +56,8 @@ private:
// wxEventLoop implementation
// ============================================================================
wxDEFINE_TIED_SCOPED_PTR_TYPE(wxEventLoopImpl)
// ----------------------------------------------------------------------------
// wxEventLoop running and exiting
// ----------------------------------------------------------------------------
@@ -71,17 +74,13 @@ int wxEventLoop::Run()
wxEventLoopActivator activate(this);
m_impl = new wxEventLoopImpl;
wxEventLoopImplTiedPtr impl(&m_impl, new wxEventLoopImpl);
gtk_main();
OnExit();
int exitcode = m_impl->GetExitCode();
delete m_impl;
m_impl = NULL;
return exitcode;
return m_impl->GetExitCode();
}
void wxEventLoop::Exit(int rc)