From 0891c2e99a3fea0b3c83dd69c4b51d7b6ead9f95 Mon Sep 17 00:00:00 2001 From: Georg Baum Date: Thu, 12 Oct 2006 19:40:04 +0000 Subject: [PATCH] Replace crash on startup with a memory leak. * 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 | 4 +--- src/frontends/qt4/GuiApplication.C | 7 +++---- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/frontends/qt3/GuiApplication.C b/src/frontends/qt3/GuiApplication.C index 0c96371d7f..63394f1330 100644 --- a/src/frontends/qt3/GuiApplication.C +++ b/src/frontends/qt3/GuiApplication.C @@ -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 { diff --git a/src/frontends/qt4/GuiApplication.C b/src/frontends/qt4/GuiApplication.C index d7293c3004..634bd7ecdb 100644 --- a/src/frontends/qt4/GuiApplication.C +++ b/src/frontends/qt4/GuiApplication.C @@ -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); -#else - lyx::frontend::GuiApplication app(argc, argv); -#endif - return &app; +#else + return new lyx::frontend::GuiApplication(argc, argv); +#endif }