Commit 57fd20e9 authored by Martin Tobias Holmedahl Sandsmark's avatar Martin Tobias Holmedahl Sandsmark
Browse files

Stop leaking qfiledialogs

parent 1cd0bb26
......@@ -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();
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment