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:
parent
08bde698ca
commit
1f758efc2f
|
@ -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();
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user