Commit 921a36de authored by twanvl's avatar twanvl

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.
parent f2fc7e0a
...@@ -46,7 +46,7 @@ class MSE : public wxApp { ...@@ -46,7 +46,7 @@ class MSE : public wxApp {
/// On exit: write the settings to the config file /// On exit: write the settings to the config file
int OnExit(); int OnExit();
/// On exception: display error message /// On exception: display error message
bool OnExceptionInMainLoop(); void HandleEvent(wxEvtHandler *handler, wxEventFunction func, wxEvent& event) const;
/// Fancier assert /// Fancier assert
#if defined(_MSC_VER) && defined(_DEBUG) #if defined(_MSC_VER) && defined(_DEBUG)
void OnAssert(const wxChar *file, int line, const wxChar *cond, const wxChar *msg); void OnAssert(const wxChar *file, int line, const wxChar *cond, const wxChar *msg);
...@@ -265,11 +265,10 @@ int MSE::OnExit() { ...@@ -265,11 +265,10 @@ int MSE::OnExit() {
// ----------------------------------------------------------------------------- : Exception handling // ----------------------------------------------------------------------------- : Exception handling
bool MSE::OnExceptionInMainLoop() { void MSE::HandleEvent(wxEvtHandler *handler, wxEventFunction func, wxEvent& event) const {
try { try {
throw; // rethrow the exception, so we can examine it wxApp::HandleEvent(handler, func, event);
} CATCH_ALL_ERRORS(true); } CATCH_ALL_ERRORS(true);
return true;
} }
#if defined(_MSC_VER) && defined(_DEBUG) #if defined(_MSC_VER) && defined(_DEBUG)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment