From: Abdelrazak Younes Date: Sat, 27 May 2006 19:58:02 +0000 (+0000) Subject: Fix for Qt4 crash on exit under linux by Georg Baum and myself. X-Git-Tag: 1.6.10~13185 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9614a1d6985f663a727c81aa4492111e257e24d4;p=lyx.git Fix for Qt4 crash on exit under linux by Georg Baum and myself. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13943 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/lyx_gui.C b/src/frontends/qt4/lyx_gui.C index 38a35a062d..82d1a7c562 100644 --- a/src/frontends/qt4/lyx_gui.C +++ b/src/frontends/qt4/lyx_gui.C @@ -152,6 +152,13 @@ bool LQApplication::macEventFilter(EventRef event) #endif +namespace { + +LQApplication * app = 0; + +} + + namespace lyx_gui { bool use_gui = true; @@ -161,16 +168,16 @@ void parse_init(int & argc, char * argv[]) // Force adding of font path _before_ QApplication is initialized FontLoader::initFontPath(); - static LQApplication app(argc, argv); + app = new LQApplication(argc, argv); // install translation file for Qt built-in dialogs // These are only installed since Qt 3.2.x static QTranslator qt_trans(0); if (qt_trans.load(QString("qt_") + QTextCodec::locale(), qInstallPathTranslations())) { - app.installTranslator(&qt_trans); + qApp->installTranslator(&qt_trans); // even if the language calls for RtL, don't do that - app.setReverseLayout(false); + qApp->setReverseLayout(false); lyxerr[Debug::GUI] << "Successfully installed Qt translations for locale " << QTextCodec::locale() << std::endl; @@ -274,6 +281,7 @@ void start(string const & batch, vector const & files) delete lyxsocket; delete lyxserver; lyxserver = 0; + delete app; }