From 78361a0e981af15db372612763a6ae4d67fb2950 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 2 May 2004 11:16:32 +0000 Subject: [PATCH] moved OnExceptionInMainLoop() in .cpp from header git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/app.h | 7 +------ src/common/appbase.cpp | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/include/wx/app.h b/include/wx/app.h index a0c4a71fb1..b2e7a337b9 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -121,12 +121,7 @@ public: // event loop: it may return true to continue running the event loop or // false to stop it (in the latter case it may rethrow the exception as // well) - virtual bool OnExceptionInMainLoop() { - throw; -#if defined(__DMC__) || (defined(_MSC_VER) && _MSC_VER < 1200) - return false; -#endif - } + virtual bool OnExceptionInMainLoop(); // Called when an unhandled C++ exception occurs inside OnRun(): note that // the exception type is lost by now, so if you really want to handle the diff --git a/src/common/appbase.cpp b/src/common/appbase.cpp index 2917c634c1..d479bef6e1 100644 --- a/src/common/appbase.cpp +++ b/src/common/appbase.cpp @@ -284,6 +284,10 @@ int wxAppConsole::FilterEvent(wxEvent& WXUNUSED(event)) return -1; } +// ---------------------------------------------------------------------------- +// exception handling +// ---------------------------------------------------------------------------- + #if wxUSE_EXCEPTIONS void @@ -295,6 +299,17 @@ wxAppConsole::HandleEvent(wxEvtHandler *handler, (handler->*func)(event); } +bool +wxAppConsole::OnExceptionInMainLoop() +{ + throw; + + // some compilers are too stupid to know that we never return after throw +#if defined(__DMC__) || (defined(_MSC_VER) && _MSC_VER < 1200) + return false; +#endif +} + #endif // wxUSE_EXCEPTIONS // ----------------------------------------------------------------------------