D14996: Fix clazy 'connect-3arg-lambda' warnings

Anton Anikin noreply at phabricator.kde.org
Wed Aug 22 13:29:50 BST 2018


antonanikin added inline comments.

INLINE COMMENTS

> kfunk wrote in midebugsession.cpp:559
> `QTimer::singleShot(5000, this, [this]() {...}` or what am I missing?
> 
> When using the `this` as context object you can also simplify the lambda-body, i.e. remove the `QPointer` helper altogether.

We can't use `this` here. On timeout our object (`this`) may be already destroyed. Therefore we use `QPointer` and check it for `nullptr` in lambda body.

REPOSITORY
  R32 KDevelop

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

To: antonanikin, #kdevelop
Cc: kfunk, kdevelop-devel, antismap, iodelay, vbspam, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20180822/fe900c36/attachment-0001.html>


More information about the KDevelop-devel mailing list