<table><tr><td style="">davidedmundson created this revision.<br />davidedmundson added a reviewer: KWin.<br />Herald added a project: KWin.<br />Herald added a subscriber: kwin.<br />davidedmundson requested review of this revision.
</td><a style="text-decoration: none; padding: 4px 8px; margin: 0 8px 8px; float: right; color: #464C5C; font-weight: bold; border-radius: 3px; background-color: #F7F7F9; background-image: linear-gradient(to bottom,#fff,#f1f0f1); display: inline-block; border: 1px solid rgba(71,87,120,.2);" href="https://phabricator.kde.org/D24594">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Context behaviour subtly changed in Qt5.14 which has exposed some<br />
questionable things in this KCM.</p>

<p>Auorae::Decoration is a context property of the loaded QML.</p>

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

<p>aurorae.qml</p>

<div class="remarkup-code-block" style="margin: 12px 0;" data-code-lang="text" data-sigil="remarkup-code-block"><pre class="remarkup-code" style="font: 11px/15px "Menlo", "Consolas", "Monaco", monospace; padding: 12px; margin: 0; background: rgba(71, 87, 120, 0.08);">DecorationOptions {
     id: options
     deco: decoration
 }</pre></div>

<p>DecorationOptions has a pointer to the previously set decoration which<br />
is now dangling, and we crash.</p>

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

<p>It also moves unreferring the shared qmlcontext we inherit from till<br />
after we've deleted the child context, because it didn't make sense.</p></div></div><br /><div><strong>TEST PLAN</strong><div><p>Opened KCM<br />
Closed the KCM<br />
didn't crash</p></div></div><br /><div><strong>REPOSITORY</strong><div><div>R108 KWin</div></div></div><br /><div><strong>BRANCH</strong><div><div>master</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D24594">https://phabricator.kde.org/D24594</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>plugins/kdecorations/aurorae/src/aurorae.cpp<br />
plugins/kdecorations/aurorae/src/aurorae.h</div></div></div><br /><div><strong>To: </strong>davidedmundson, KWin<br /><strong>Cc: </strong>kwin, LeGast00n, The-Feren-OS-Dev, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, romangg, jensreuterberg, abetts, sebas, apol, ahiemstra, mart<br /></div>