]> git.lyx.org Git - lyx.git/commitdiff
GuiApplication::notify(): fine tune ErrorException handling; close all windows before...
authorAbdelrazak Younes <younes@lyx.org>
Thu, 28 Feb 2008 20:40:55 +0000 (20:40 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Thu, 28 Feb 2008 20:40:55 +0000 (20:40 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23333 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiApplication.cpp

index 707bdbad0d02f34dc9d806f63bbb504faa2feddd..5436944aeed61ba5577b92ee55c13624f181a39a 100644 (file)
@@ -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;