From: Mikko Rasa Date: Wed, 23 Jul 2008 13:03:21 +0000 (+0000) Subject: Report uncaught exceptions with a MessageBox on win32 X-Git-Tag: 1.0~3 X-Git-Url: http://git.tdb.fi/?p=libs%2Fcore.git;a=commitdiff_plain;h=d61601ce7f87044c8ddd1e097d8d8743f06e84b4 Report uncaught exceptions with a MessageBox on win32 --- 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; } }