From: Abdelrazak Younes Date: Thu, 28 Feb 2008 20:40:55 +0000 (+0000) Subject: GuiApplication::notify(): fine tune ErrorException handling; close all windows before... X-Git-Tag: 1.6.10~5996 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0e67e8423f55af58ab8e9b5c4d0b5776a1df0cbc;p=lyx.git GuiApplication::notify(): fine tune ErrorException handling; close all windows before showing the alert. This should get rid of the recursive alert box when an the exception is caught. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23333 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 707bdbad0d..5436944aee 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -468,8 +468,16 @@ bool GuiApplication::notify(QObject * receiver, QEvent * event) } catch (ExceptionMessage const & e) { if (e.type_ == ErrorException) { + LyX::cref().emergencyCleanup(); + setQuitOnLastWindowClosed(false); + closeAllViews(); Alert::error(e.title_, e.details_); - LyX::cref().exit(1); +#ifndef NDEBUG + // Properly crash in debug mode in order to get a useful backtrace. + abort(); +#endif + // In release mode, try to exit gracefully. + this->exit(1); } else if (e.type_ == WarningException) { Alert::warning(e.title_, e.details_); return false;