D23067: Clean up usage of m_client
Roman Gilg
noreply at phabricator.kde.org
Sat Aug 10 13:49:53 BST 2019
romangg added inline comments.
INLINE COMMENTS
> gladhorn wrote in useractions.cpp:137
> Asserts are not active in release mode. I was very conservative, but I assume all of this is single-threaded? In that case I would indeed assume that m_client is not nullptr.
> On the other hand, I'd like to have my window manager crash in debug mode because of invalid assumptions and let it keep running in release builds.
Ok, how about:
- Leave the assert
- Afterwards directly do the cl.isNull() check
- Add a comment above that you are not yet sure if the assert really holds always
- Remove all m_client checks afterwards anyway (since we checked cl.isNull() and I don't see how the pointer can get deleted in between. It's running in a single thread.
But looking at `Workspace::slotWindowOperations`, the only place show is called from, it checks before that the argument is non-null. So we should not need a check.
REPOSITORY
R108 KWin
REVISION DETAIL
https://phabricator.kde.org/D23067
To: gladhorn, #kwin
Cc: romangg, zzag, kwin, LeGast00n, sbergeron, jraleigh, fbampaloukas, GB_2, mkulinski, ragreen, jackyalcine, Pitel, iodelay, crozbo, bwowk, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, hardening, jensreuterberg, abetts, sebas, apol, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwin/attachments/20190810/e47c2713/attachment.html>
More information about the kwin
mailing list