On quinta-feira, 14 de março de 2013 18.33.38, Etienne Sandré-Chardonnal
wrote:
> Is it safe and correct to connect QThread::quit() and QThread::terminated()
> to Worker::deleteLater() ? I would say no, as signal/slot mechanism will
> try to run deleteLater() in the workerThread, which is not running anymore,
> so object deletion will never happen.

That's actually very good thinking, showing you understand how threads work.

But we added a little bit of magic to the event dispatcher: after the
finished() signal is emitted, it runs all events once again to process object
deletions. You couldn't have known that by simple analysis.

In other words, you can connect finished() to deleteLater() and it will work.
--
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Interest mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to