From 5343a18b50e990d75f4434b3bb70b376ab935076 Mon Sep 17 00:00:00 2001 From: Hugo Pereira Da Costa Date: Wed, 5 Dec 2012 21:44:06 +0100 Subject: [PATCH] Added curly brackets around DolphinApplication creation and execution, to make sure it is deleted before "return 0;" is called. This might prevent random crashes due to the de-allocation chain in Qt at exit. CCBUG: 311092 --- dolphin/src/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dolphin/src/main.cpp b/dolphin/src/main.cpp index 39ecee8b8b..6dd2b1e749 100644 --- a/dolphin/src/main.cpp +++ b/dolphin/src/main.cpp @@ -82,11 +82,13 @@ KDE_EXPORT int kdemain(int argc, char **argv) options.add("+[Url]", ki18nc("@info:shell", "Document to open")); KCmdLineArgs::addCmdLineOptions(options); - DolphinApplication app; - if (app.isSessionRestored()) { - app.restoreSession(); + { + DolphinApplication app; + if (app.isSessionRestored()) { + app.restoreSession(); + } + app.exec(); // krazy:exclude=crashy } - app.exec(); // krazy:exclude=crashy return 0; }