Verified Commit ba293233 authored by Fushan Wen's avatar Fushan Wen
Browse files

qtquickdialogwrapper: Fix memory leak caused by `QQmlComponent::create`

The created component is not deleted after QtQuickDialogWrapper is
destructed, Set its parent to fix the memory leak.

CCBUG: 452865
parent 5859827f
Pipeline #167843 failed with stage
in 2 minutes and 23 seconds
......@@ -50,6 +50,8 @@ QtQuickDialogWrapper::QtQuickDialogWrapper(const QString &configFile, QObject *p
d->item = component.create();
// If there is an error on the QML side of things we get a nullptr
if (d->item) {
QObject *qtquickEngine = d->item->property("engine").value<QObject *>();
d->coreEngine = qtquickEngine->property("engine").value<KNSCore::Engine *>();
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