From 4a31b77d2c2327d359e115f5607bfe693f17dd1e Mon Sep 17 00:00:00 2001 From: twanvl Date: Wed, 21 Jul 2010 18:52:40 +0000 Subject: [PATCH] Use a HandleEvent wrapper instead of OnExceptionInMainLoop. This way we don't rely on rethrowing exceptions. This method has proven to work well in other projects. git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1452 0fc631ac-6414-0410-93d0-97cfa31319b6 --- src/main.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 89357526..f28cd894 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -46,7 +46,7 @@ class MSE : public wxApp { /// On exit: write the settings to the config file int OnExit(); /// On exception: display error message - bool OnExceptionInMainLoop(); + void HandleEvent(wxEvtHandler *handler, wxEventFunction func, wxEvent& event) const; /// Fancier assert #if defined(_MSC_VER) && defined(_DEBUG) void OnAssert(const wxChar *file, int line, const wxChar *cond, const wxChar *msg); @@ -265,11 +265,10 @@ int MSE::OnExit() { // ----------------------------------------------------------------------------- : Exception handling -bool MSE::OnExceptionInMainLoop() { +void MSE::HandleEvent(wxEvtHandler *handler, wxEventFunction func, wxEvent& event) const { try { - throw; // rethrow the exception, so we can examine it + wxApp::HandleEvent(handler, func, event); } CATCH_ALL_ERRORS(true); - return true; } #if defined(_MSC_VER) && defined(_DEBUG)