anthonyfieroni added a comment.
`auto c = client().toStrongRef().data();`
This is completely wrong, the idea behind shared / weak pointer is ability to
know when non-owning resource goes out of scope. by calling toStrongRef you
extend its lifetime if and only if it exists at time of call then holding this
ref you ensure that resource will not be destroyed meanwhile. By holding data()
it does nothing to extend resource lifetime but getting a pointer to well-known
dying object. It should be
`auto c = m_decoration.data()->client().toStrongRef();`
Last but not least, c can be nullptr check against null should be performed
as well. Exp
xcb_window_t windowId;
auto c = m_decoration.data()->client().toStrongRef();
if (c && (windowId = c->windowId())) {
} else {
hide();
}
It should be added checks in all use places.
REPOSITORY
R31 Breeze
REVISION DETAIL
https://phabricator.kde.org/D26267
To: ndavis, #breeze, #plasma
Cc: anthonyfieroni, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh,
zachus, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf,
lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart