1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

Fix crash in ~Core

This commit is contained in:
tux3 2015-06-04 14:31:13 +02:00
parent 42a7efb053
commit 4e2983817f
2 changed files with 4 additions and 4 deletions

View File

@ -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;
}

View File

@ -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;