From 4e2983817fbf0e6411b39162b925621cd0e8e756 Mon Sep 17 00:00:00 2001 From: tux3 Date: Thu, 4 Jun 2015 14:31:13 +0200 Subject: [PATCH] Fix crash in ~Core --- src/core/core.cpp | 6 +++--- src/core/core.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core/core.cpp b/src/core/core.cpp index 4b6415caf..d870950a9 100644 --- a/src/core/core.cpp +++ b/src/core/core.cpp @@ -107,11 +107,10 @@ Core::~Core() if (coreThread->isRunning()) { if (QThread::currentThread() == coreThread) - stopTimers(); + killTimers(); else QMetaObject::invokeMethod(this, "stopTimers", Qt::BlockingQueuedConnection); } - delete toxTimer; coreThread->exit(0); while (coreThread->isRunning()) { @@ -1248,8 +1247,9 @@ void Core::resetCallSources() } } -void Core::stopTimers() +void Core::killTimers() { assert(QThread::currentThread() == coreThread); toxTimer->stop(); + delete toxTimer; } diff --git a/src/core/core.h b/src/core/core.h index f963d221e..05d044ec7 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -286,7 +286,7 @@ private: void deadifyTox(); private slots: - void stopTimers(); ///< Must only be called from the Core thread + void killTimers(); ///< Must only be called from the Core thread private: Tox* tox;