On quarta-feira, 24 de fevereiro de 2016 10:22:18 PST Lorenz Haas wrote:
>    Foo() : QObject(nullptr) {
>       moveToThread(&m_thread);
>       m_thread.start();
>    }
> 
>    ~Foo() {
>       m_thread.quit();
>       m_thread.wait();
>    }

This destructor is either never run or deadlocks.

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.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to