<table><tr><td style="">alnikiforov created this revision.<br />alnikiforov added reviewers: ngraham, davidedmundson, mart.<br />Herald added a project: Plasma.<br />Herald added a subscriber: plasma-devel.<br />alnikiforov 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/D27650">View Revision</a></tr></table><br /><div><strong>REVISION SUMMARY</strong><div><p>Using these pointer types incorrectly leads to premature destruction<br />
of AppletsLayout object and crash</p>
<p>AppletsLayout m_layout is set only in function ItemContainer::setLayout.<br />
This function takes a plain pointer and wraps it into weak shared pointer.<br />
Eventually weak shared pointer's internal counter reaches zero and object instance m_layout points to is destroyed,<br />
although it was created via qml in plasma-desktop. This object destruction leads to a lot of issues, including eventual crash.</p>
<p>BUG: 417603</p></div></div><br /><div><strong>TEST PLAN</strong><div><ol class="remarkup-list">
<li class="remarkup-list-item">Unlock widgets via command: qdbus org.kde.plasmashell /PlasmaShell evaluateScript "lockCorona(false)"</li>
<li class="remarkup-list-item">On desktop push right mouse button and select menu item 'Add Widgets...'</li>
<li class="remarkup-list-item">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</li>
<li class="remarkup-list-item">Remove just added widgets in random order</li>
<li class="remarkup-list-item">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.</li>
<li class="remarkup-list-item">lock widgets via command: qdbus org.kde.plasmashell /PlasmaShell evaluateScript "lockCorona(true)"</li>
<li class="remarkup-list-item">repeat steps 1-6 multiple times</li>
<li class="remarkup-list-item">plasmashell shouldn't crash</li>
</ol></div></div><br /><div><strong>REPOSITORY</strong><div><div>R120 Plasma Workspace</div></div></div><br /><div><strong>REVISION DETAIL</strong><div><a href="https://phabricator.kde.org/D27650">https://phabricator.kde.org/D27650</a></div></div><br /><div><strong>AFFECTED FILES</strong><div><div>components/containmentlayoutmanager/itemcontainer.h</div></div></div><br /><div><strong>To: </strong>alnikiforov, ngraham, davidedmundson, mart<br /><strong>Cc: </strong>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<br /></div>