Diffusion KWin 446e23af5a5f

[aurorae] Fix crash on KCM teardown with Qt5.14

Authored by davidedmundson on Oct 15 2019, 11:40 AM.

Description

[aurorae] Fix crash on KCM teardown with Qt5.14

Summary:
Context behaviour subtly changed in Qt5.14 which has exposed some
questionable things in this KCM.

Auorae::Decoration is a context property of the loaded QML.

QObject::~QObject signals it's own deletion before deleting children.
This means the bindings of loaded QML update in particular

aurorae.qml

DecorationOptions {
     id: options
     deco: decoration
 }

DecorationOptions has a pointer to the previously set decoration which
is now dangling, and we crash.

Rather than adding more guards and smart pointers in DecorationOptions,
this patch deletes the QQmlContext before deleting the context
properties that we expose.

It also moves unreferring the shared qmlcontext we inherit from till
after we've deleted the child context, because it didn't make sense.

Test Plan:
Opened KCM
Closed the KCM
didn't crash

Reviewers: KWin, zzag

Reviewed By: KWin, zzag

Subscribers: kwin

Tags: KWin

Differential Revision: https://phabricator.kde.org/D24594

Details

Committed
davidedmundsonOct 15 2019, 11:40 AM
Reviewer
KWin
Differential Revision
D24594: [aurorae] Fix crash on KCM teardown with Qt5.14
Parents
R108:82f4e03d7a4c: Merge branch 'Plasma/5.12' into Plasma/5.17
Branches
Unknown
Tags
Unknown