D27650: Don't use guarded pointers for AppletsLayout

Aleksei Nikiforov noreply at phabricator.kde.org
Tue Feb 25 14:21:56 GMT 2020


alnikiforov created this revision.
alnikiforov added reviewers: ngraham, davidedmundson, mart.
Herald added a project: Plasma.
Herald added a subscriber: plasma-devel.
alnikiforov requested review of this revision.

REVISION SUMMARY
  Using these pointer types incorrectly leads to premature destruction
  of AppletsLayout object and crash
  
  AppletsLayout m_layout is set only in function ItemContainer::setLayout.
  This function takes a plain pointer and wraps it into weak shared pointer.
  Eventually weak shared pointer's internal counter reaches zero and object instance m_layout points to is destroyed,
  although it was created via qml in plasma-desktop. This object destruction leads to a lot of issues, including eventual crash.
  
  BUG: 417603

TEST PLAN
  1. Unlock widgets via command: qdbus org.kde.plasmashell /PlasmaShell evaluateScript "lockCorona(false)"
  2. On desktop push right mouse button and select menu item 'Add Widgets...'
  3. Add various widgets to desktop using drag'n'drop on desktop. I've added at least following widgets on same desktop screen: Audio Volume, Battery and Brightness, Binary Clock, Clipboard, Color Picker, Grouping Plasmoid, Quick Chat
  4. Remove just added widgets in random order
  5. If necessary, repeat steps 3 and 4 a few times If widgets aren't appearing on desktop despite adding them via drag'n'drop, it's bugged and ready to crash. But it's not a requirement for crash.
  6. lock widgets via command: qdbus org.kde.plasmashell /PlasmaShell evaluateScript "lockCorona(true)"
  7. repeat steps 1-6 multiple times
  8. plasmashell shouldn't crash

REPOSITORY
  R120 Plasma Workspace

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

AFFECTED FILES
  components/containmentlayoutmanager/itemcontainer.h

To: alnikiforov, ngraham, davidedmundson, mart
Cc: plasma-devel, Orage, LeGast00n, The-Feren-OS-Dev, cblack, jraleigh, zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20200225/900ae36f/attachment-0001.html>


More information about the Plasma-devel mailing list