From: Georg Baum Date: Thu, 12 Oct 2006 19:40:04 +0000 (+0000) Subject: Replace crash on startup with a memory leak. X-Git-Tag: 1.6.10~12401 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=0891c2e99a3fea0b3c83dd69c4b51d7b6ead9f95;p=lyx.git 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 --- 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); + return &app; #else - lyx::frontend::GuiApplication app(argc, argv); + return new lyx::frontend::GuiApplication(argc, argv); #endif - - return &app; }