]> git.lyx.org Git - lyx.git/commitdiff
Replace crash on startup with a memory leak.
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 12 Oct 2006 19:40:04 +0000 (19:40 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Thu, 12 Oct 2006 19:40:04 +0000 (19:40 +0000)
* src/frontends/qt[34]/GuiApplication.C
(lyx::frontend::Application * createApplication): Don't return the
address of a temporary, but use the new operator.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15313 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt3/GuiApplication.C
src/frontends/qt4/GuiApplication.C

index 0c96371d7fd21a40b2ac8d5fc99d54a330e374e8..63394f1330cd1e52fbd065d06ae9efa62bdfc13f 100644 (file)
@@ -79,9 +79,7 @@ namespace lyx {
 
 frontend::Application * createApplication(int & argc, char * argv[])
 {
-       frontend::GuiApplication app(argc, argv);
-
-       return &app;
+       return new frontend::GuiApplication(argc, argv);
 }
 
 namespace frontend {
index d7293c3004688d56b77f2025d3f2f7e817ef8c05..634bd7ecdb46fda27795d13585c521a3a709e8d8 100644 (file)
@@ -80,11 +80,10 @@ lyx::frontend::Application * createApplication(int & argc, char * argv[])
 
 #if defined(Q_WS_WIN) && !defined(Q_CYGWIN_WIN)
        static lyx::frontend::GuiApplication app(argc, argv);
+       return &app;
 #else
-       lyx::frontend::GuiApplication app(argc, argv);
+       return new lyx::frontend::GuiApplication(argc, argv);
 #endif
-
-       return &app;
 }