QtService stop Subthreads
Hi,
I have an application using QtService and a Worker-Class with a couple of Subthreads. Now I have a Problem that I'm not sure how to wait in the Service-Stop funtion that all Subthreads are ended. I tried it in the way:
QEventLoop loop;
loop.connect(&thread, SIGNAL(finished()), SLOT(quit()));
loop.exec();
where "thread" is the thread Controlling the main-Workerclass. It is stopped when the last Subthtread is finished. This works okay. But in the Servcie the end of the QEventLoop is never reached. Is my way completly wrong?
Thanks and regards,
Willi
Re: QtService stop Subthreads
Have you told the thread to stop or are you just assuming that it will?
Re: QtService stop Subthreads
Yes, I told all threads to Exit. But I found the Problem. One of the threads did not Exit properly. So the way to wait in the stop()-function of the QtService is fine.
Thx!