Merge branch 'master' of www.klayout.org:/home/matthias/klayout

This commit is contained in:
Matthias Koefferlein 2017-11-01 22:14:33 +01:00
commit 4599d342ef
1 changed files with 22 additions and 12 deletions

View File

@ -216,20 +216,30 @@ LONG WINAPI ExceptionHandler(PEXCEPTION_POINTERS pExceptionInfo)
SymCleanup (process); SymCleanup (process);
// YES! I! KNOW! bool has_gui = lay::Application::instance () && lay::Application::instance ()->has_gui ();
// In a signal handler you shall not do fancy stuff (in particular not if (has_gui) {
// open dialogs) nor shall you throw exceptions! But that scheme appears to
// be working since in most cases the signal is raised from our code (hence // YES! I! KNOW!
// from our stack frames) and everything is better than just showing // In a signal handler you shall not do fancy stuff (in particular not
// the "application stopped working" dialog. // open dialogs) nor shall you throw exceptions! But that scheme appears to
// Isn't it? // be working since in most cases the signal is raised from our code (hence
// from our stack frames) and everything is better than just showing
// the "application stopped working" dialog.
// Isn't it?
CrashMessage msg (0, true, text);
if (! msg.exec ()) {
// terminate unconditionally
return EXCEPTION_EXECUTE_HANDLER;
} else {
throw tl::CancelException ();
}
CrashMessage msg (0, true, text);
if (! msg.exec ()) {
// terminate unconditionally
return EXCEPTION_EXECUTE_HANDLER;
} else { } else {
throw tl::CancelException ();
tl::error << text << tl::noendl;
return EXCEPTION_EXECUTE_HANDLER;
} }
} }