From 57fd20e90e3e13a6fd7fdeb638a4d06316f5e809 Mon Sep 17 00:00:00 2001 From: "Martin T. H. Sandsmark" Date: Sat, 13 Aug 2016 22:20:43 +0200 Subject: [PATCH] Stop leaking qfiledialogs --- shell/shell.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/shell/shell.cpp b/shell/shell.cpp index 65997b489..dfce15483 100644 --- a/shell/shell.cpp +++ b/shell/shell.cpp @@ -463,12 +463,15 @@ void Shell::fileOpen() dlg->setNameFilters( namePatterns ); dlg->setWindowTitle( i18n("Open Document") ); - if ( !dlg->exec() || !dlg) - return; + if ( dlg->exec() && dlg ) { + foreach(const QUrl& url, dlg->selectedUrls()) + { + openUrl( url ); + } + } - foreach(const QUrl& url, dlg->selectedUrls()) - { - openUrl( url ); + if ( dlg ) { + delete dlg.data(); } }