[Qt-interest] QThread run() method

Sarvesh Saran Sarvesh.Saran at synopsys.com
Mon Aug 31 12:35:43 CEST 2009


Hi,

This question is a little naïve but I still need an answer to it.

What happens to  a QThread after the run method is done? The documentation says the execution ends when you return from run. Does that mean the thread object ceases to exists ? for some reason my thread manages to receive a signal and execute a slot even after the run method is done .i.e.

Qthread *th = new Qthread();
th->start
...
..
And later when the thread has finished its run method..

th->sendStopSignal(); (thread is not running at this point, th->isRunning() returns false)
delete th;
th=NULL;

(for some reason th receives this signal and executes the slot)

Thanks,
Sarvesh

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090831/0ec66f94/attachment.html 


More information about the Qt-interest-old mailing list