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

Delete CoreAV from the Core thread

Since it was created there

Fixes #2457
This commit is contained in:
tux3 2015-10-23 19:42:39 +02:00
parent 08bde698ca
commit 1f758efc2f
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
2 changed files with 10 additions and 4 deletions

View File

@ -77,6 +77,12 @@ Core::Core(QThread *CoreThread, Profile& profile) :
void Core::deadifyTox()
{
if (QThread::currentThread() != coreThread)
{
QMetaObject::invokeMethod(this, "deadifyTox", Qt::BlockingQueuedConnection);
return;
}
if (av)
{
delete av;
@ -99,6 +105,9 @@ Core::~Core()
QMetaObject::invokeMethod(this, "killTimers", Qt::BlockingQueuedConnection,
Q_ARG(bool, false));
}
deadifyTox();
coreThread->exit(0);
while (coreThread->isRunning())
{
@ -106,8 +115,6 @@ Core::~Core()
coreThread->wait(500);
}
deadifyTox();
Audio& audio = Audio::getInstance();
audio.closeInput();
audio.closeOutput();

View File

@ -223,10 +223,9 @@ private:
void checkLastOnline(uint32_t friendId);
void deadifyTox();
private slots:
void killTimers(bool onlyStop); ///< Must only be called from the Core thread
void deadifyTox(); ///< Will call itself blocking queued on the Core thread
private:
Tox* tox;