The recommendation is to use the 4-arg overload, which takes a context object so that the lambda isn't executed when the context object is deleted.
Details
Details
- Reviewers
kfunk - Group Reviewers
KDevelop - Commits
- R32:e3660a2d6dce: Fix clazy 'connect-3arg-lambda' warnings
Diff Detail
Diff Detail
- Repository
- R32 KDevelop
- Branch
- arcpatch-D14996
- Lint
No Linters Available - Unit
No Unit Test Coverage - Build Status
Buildable 2117 Build 2135: arc lint + arc unit
plugins/debuggercommon/midebugsession.cpp | ||
---|---|---|
556–557 | Here we suppress warning instead of fixing because of suitable receiver missing. Maybe we can use qApp as a receiver? |
plugins/debuggercommon/midebugsession.cpp | ||
---|---|---|
556–557 | 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. |
plugins/debuggercommon/midebugsession.cpp | ||
---|---|---|
556–557 | 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. |
plugins/debuggercommon/midebugsession.cpp | ||
---|---|---|
556–557 | Although I was wrong, sorry - we can (and should) use this here. Will update the revision. |