Implement Angus suggestion.

* GuiApplication::notify(): try to catch 'normal' exception first.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17696 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-04-02 10:18:12 +00:00
parent c9744fec96
commit c1b5490f9f

View File

@ -52,6 +52,8 @@
#include <boost/bind.hpp> #include <boost/bind.hpp>
#include <exception>
using std::string; using std::string;
using std::endl; using std::endl;
@ -220,10 +222,13 @@ bool GuiApplication::notify(QObject * receiver, QEvent * event)
try { try {
return_value = QApplication::notify(receiver, event); return_value = QApplication::notify(receiver, event);
} }
catch (std::exception const & e) {
lyxerr << "Caught \"normal\" exception: " << e.what() << endl;
LyX::cref().emergencyCleanup();
abort();
}
catch (...) { catch (...) {
lyxerr << "ERROR: Exception caught in the Qt event loop, exiting..." lyxerr << "Caught some really weird exception..." << endl;
<< endl;
LyX::cref().emergencyCleanup(); LyX::cref().emergencyCleanup();
abort(); abort();
} }