Re: QThread blocking wait()
The correct way is
Code:
void qkReceptor::stop()
{
this->quit();
this->wait(); // Infinite loop here
}
Re: QThread blocking wait()
I'd like to note that wait() should be called not from the thread itself but from a thread that created it (which I guess is what you are trying to do or might be trying to do). The semantics for this call is "block me here until the thread in question has finished its execution". If you call it from the worker thread itself then the thread will be suspended and will never finish thus wait() will never end and you'll have a deadlock.