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:
parent
42a7efb053
commit
4e2983817f
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user