[Interest] moveToThread used in constructor to move "this"

Lorenz Haas lykurg at gmail.com
Wed Feb 24 22:20:49 CET 2016


> This destructor is either never run or deadlocks.

Indeed, my example/test code was bad. The destructor was never called
and thus I haven't saw the error output.

> A QObject can only be destroyed in its thread of affinity. So the above is 
> running in that m_thread thread, which means it hasn't exited. Waiting for it 
> to exit will wait forever.

Thanks for spotting this issue and pointing it out. The "self managing
class" was so tempting ... but it's not working :(

Thanks for your help.

Lorenz



More information about the Interest mailing list