summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Bastian <thierry.bastian@nokia.com>2009-11-27 11:19:14 (GMT)
committerThierry Bastian <thierry.bastian@nokia.com>2009-11-27 11:20:08 (GMT)
commit61f2e17c497f683d7fa78232decb260bfa5b5d77 (patch)
treecec4350d88c2a7f42022c21545183447171e72fa
parent583b1529894aca5e9ffa353f0547dfb4b8b0ab21 (diff)
downloadQt-61f2e17c497f683d7fa78232decb260bfa5b5d77.zip
Qt-61f2e17c497f683d7fa78232decb260bfa5b5d77.tar.gz
Qt-61f2e17c497f683d7fa78232decb260bfa5b5d77.tar.bz2
Fixed a memory leak in the newer native filedialog on windows
Reviewed-by: denis
-rw-r--r--src/gui/dialogs/qfiledialog_win.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/dialogs/qfiledialog_win.cpp b/src/gui/dialogs/qfiledialog_win.cpp
index d8ae73e..0116319 100644
--- a/src/gui/dialogs/qfiledialog_win.cpp
+++ b/src/gui/dialogs/qfiledialog_win.cpp
@@ -534,7 +534,7 @@ QStringList qt_win_CID_get_open_file_names(const QFileDialogArgs &args,
modal_widget.setParent(args.parent, Qt::Window);
QApplicationPrivate::enterModal(&modal_widget);
// Multiple selection is allowed only in IFileOpenDialog.
- IFileOpenDialog *pfd;
+ IFileOpenDialog *pfd = 0;
HRESULT hr = CoCreateInstance(CLSID_FileOpenDialog,
NULL,
CLSCTX_INPROC_SERVER,
@@ -607,6 +607,8 @@ QStringList qt_win_CID_get_open_file_names(const QFileDialogArgs &args,
}
}
}
+ if (pfd)
+ pfd->Release();
return result;
}