D23067: Clean up usage of m_client

Roman Gilg <[email protected]>
Newsgroups gmane.comp.kde.devel.kwin
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.