From d61601ce7f87044c8ddd1e097d8d8743f06e84b4 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Wed, 23 Jul 2008 13:03:21 +0000 Subject: [PATCH] Report uncaught exceptions with a MessageBox on win32 --- source/core/application.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/core/application.cpp b/source/core/application.cpp index bcb7e3d..cc9946c 100644 --- a/source/core/application.cpp +++ b/source/core/application.cpp @@ -62,6 +62,12 @@ int Application::run(int argc, char **argv, void *data) } catch(const exception &e) { + delete app_; + +#ifdef WIN32 + string msg=Debug::demangle(typeid(e).name())+":\n"+e.what(); + MessageBox(0, msg.c_str(), "Uncaught exception", MB_OK|MB_ICONERROR); +#else cerr<<"An uncaught exception occurred.\n"; cerr<<" type: "<file<<'\n'; } } +#endif - delete app_; return 124; } } -- 2.43.0