From 9b9b6bae991d891ef2717c02bc9a44a45c784cdd Mon Sep 17 00:00:00 2001 From: "Tux3 / Mlkj / !Lev.uXFMLA" Date: Sat, 24 Jan 2015 19:48:23 +0100 Subject: [PATCH] Prevent possible deadlock on exit --- src/core.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core.cpp b/src/core.cpp index 197e5830b..0b5ff1f74 100644 --- a/src/core.cpp +++ b/src/core.cpp @@ -99,10 +99,11 @@ Core::~Core() toxTimer->stop(); coreThread->exit(0); - qApp->processEvents(); - coreThread->wait(); - if (coreThread->isRunning()) - coreThread->terminate(); + while (coreThread->isRunning()) + { + qApp->processEvents(); + coreThread->wait(500); + } if (tox) {