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

David Edmundson noreply at phabricator.kde.org
Sat Oct 12 16:18:10 BST 2019


davidedmundson created this revision.
davidedmundson added a reviewer: KWin.
Herald added a project: KWin.
Herald added a subscriber: kwin.
davidedmundson requested review of this revision.

REVISION 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

REPOSITORY
  R108 KWin

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D24594

AFFECTED FILES
  plugins/kdecorations/aurorae/src/aurorae.cpp
  plugins/kdecorations/aurorae/src/aurorae.h

To: davidedmundson, #kwin
Cc: 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20191012/e7fb22e1/attachment.html>


More information about the kwin mailing list