void DrawingWindow::closeEvent(QCloseEvent *ev)
{
timer.stop();
- thread->terminate();
+ thread->exit();
syncMutex.lock();
mouseMutex.lock();
terminateThread = true; // this flag is needed for the case
mouseMutex.unlock();
syncMutex.unlock();
QWidget::closeEvent(ev);
- thread->wait();
+ if (!thread->wait(250)) {
+ thread->terminate();
+ thread->wait();
+ }
}
/*!