Fix memory leak

Destroy the QDBusPendingCallWatcher object when received
the QDBusPendingCallWatcher::finished signal later.

Pick-to: 5.15 6.2
Change-Id: I1ec67bf7c286f38200c374ad92df2a1579588a8a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
JiDe Zhang 2021-09-28 17:46:16 +08:00
parent 52ad59f9ea
commit 71ba53e3a7
2 changed files with 2 additions and 0 deletions

View File

@ -302,6 +302,7 @@ void QXdgDesktopPortalFileDialog::openPortal()
this,
SLOT(gotResponse(uint,QVariantMap)));
}
watcher->deleteLater();
});
}

View File

@ -111,6 +111,7 @@ QXdgDesktopPortalTheme::QXdgDesktopPortalTheme()
if (reply.isValid()) {
d->fileChooserPortalVersion = reply.value().toUInt();
}
watcher->deleteLater();
});
}