From d8f106eab2babee929f393de030eb2e8be58f874 Mon Sep 17 00:00:00 2001 From: Ilya Fedin Date: Thu, 2 Jun 2022 02:33:04 +0400 Subject: [PATCH] Fix a leak of fallback dialog helper in xdgdesktopportal Task-number: QTBUG-98988 Change-Id: Id066f0dd2cacbc273deacd4f7df66c3787ad4017 Reviewed-by: Thiago Macieira (cherry picked from commit 36c1a7ba23eab079683a344dc34094c28a9f56e2) Reviewed-by: Qt Cherry-pick Bot --- .../xdgdesktopportal/qxdgdesktopportalfiledialog.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp index 55eb0b5affe..50d60dce132 100644 --- a/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp +++ b/src/plugins/platformthemes/xdgdesktopportal/qxdgdesktopportalfiledialog.cpp @@ -88,7 +88,7 @@ public: QString selectedMimeTypeFilter; QString selectedNameFilter; QStringList selectedFiles; - QPlatformFileDialogHelper *nativeFileDialog = nullptr; + std::unique_ptr nativeFileDialog; }; QXdgDesktopPortalFileDialog::QXdgDesktopPortalFileDialog(QPlatformFileDialogHelper *nativeFileDialog) @@ -98,8 +98,8 @@ QXdgDesktopPortalFileDialog::QXdgDesktopPortalFileDialog(QPlatformFileDialogHelp Q_D(QXdgDesktopPortalFileDialog); if (d->nativeFileDialog) { - connect(d->nativeFileDialog, SIGNAL(accept()), this, SIGNAL(accept())); - connect(d->nativeFileDialog, SIGNAL(reject()), this, SIGNAL(reject())); + connect(d->nativeFileDialog.get(), SIGNAL(accept()), this, SIGNAL(accept())); + connect(d->nativeFileDialog.get(), SIGNAL(reject()), this, SIGNAL(reject())); } }