[clazy] [Bug 407925] New: new check: directly calling a method on a QObject after it has been moved to another thread
bugzilla_noreply at kde.org
bugzilla_noreply at kde.org
Sat May 25 05:28:24 BST 2019
https://bugs.kde.org/show_bug.cgi?id=407925
Bug ID: 407925
Summary: new check: directly calling a method on a QObject
after it has been moved to another thread
Product: clazy
Version: unspecified
Platform: Other
OS: Linux
Status: REPORTED
Severity: wishlist
Priority: NOR
Component: general
Assignee: unassigned-bugs at kde.org
Reporter: d3fault at d3fault.net
CC: smartins at kde.org
Target Milestone: ---
After a call to moveToThread, that object pointer shouldn't be used to directly
call any methods, except thread-safe ones such as deleteLater. invokeMethod
should be used instead.
A fixit could be provided which automatically converts the direct method calls
to invokeMethod calls, preferably using the new pmf/lambda invokeMethod
overload.
More generally we could flag and offer a fixit for _any_ direct call to a
QObject's method, not just calls that occur after a moveToThread. It's good to
always write thread-safe code. See QTCREATORBUG-15972 for the inspiration of
this suggestion.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the Unassigned-bugs
mailing list