From f19811517a714ae19e8222727eaaa39d65605cd0 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 --- src/main.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 39ecee8b8..6dd2b1e74 100644 --- a/src/main.cpp +++ b/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; } -- 2.47.3