diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 9fdb525f77..993d4a8d53 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -171,9 +171,6 @@ bool wxAppConsole::Initialize(int& argcOrig, wxChar **argvOrig) wxPendingEventsLocker = new wxCriticalSection; #endif - // create port-specific main loop - m_mainLoop = CreateMainLoop(); - #ifndef __WXPALMOS__ if ( m_appName.empty() && argv ) { @@ -192,8 +189,11 @@ wxEventLoopBase *wxAppConsole::CreateMainLoop() void wxAppConsole::CleanUp() { - delete m_mainLoop; - m_mainLoop = NULL; + if ( m_mainLoop ) + { + delete m_mainLoop; + m_mainLoop = NULL; + } delete wxPendingEvents; wxPendingEvents = NULL;