summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-08-13 20:20:43 (GMT)
committerMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-08-13 20:20:43 (GMT)
commit57fd20e90e3e13a6fd7fdeb638a4d06316f5e809 (patch)
tree982f3056b9a95242465b60312dc39c010200bf75
parent1cd0bb269744013083a9c0ce8699842729cfcc30 (diff)
Stop leaking qfiledialogs
-rw-r--r--shell/shell.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/shell/shell.cpp b/shell/shell.cpp
index 65997b4..dfce154 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();
}
}