]> git.lyx.org Git - lyx.git/commitdiff
Fix for Qt4 crash on exit under linux by Georg Baum and myself.
authorAbdelrazak Younes <younes@lyx.org>
Sat, 27 May 2006 19:58:02 +0000 (19:58 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sat, 27 May 2006 19:58:02 +0000 (19:58 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13943 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/lyx_gui.C

index 38a35a062d44d68e1a668b851fa27e4052fc72c9..82d1a7c5622eae728a94ef0a66e76c916ed29f19 100644 (file)
@@ -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<string> const & files)
        delete lyxsocket;
        delete lyxserver;
        lyxserver = 0;
+       delete app;
 }