mirror of https://github.com/KLayout/klayout.git
Crash handler does not pop up window in batch mode now.
This commit is contained in:
parent
5d9513b6a5
commit
ccf6570d46
|
|
@ -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;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue