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

Fix possible crashes on exit, add debug info

This commit is contained in:
Tux3 / Mlkj / !Lev.uXFMLA 2015-01-24 19:32:07 +01:00
parent d35ebb22f0
commit 6e1484252a
No known key found for this signature in database
GPG Key ID: 7E086DD661263264
3 changed files with 10 additions and 4 deletions

View File

@ -66,8 +66,11 @@ Audio& Audio::getInstance()
Audio::~Audio()
{
audioThread->wait(100);
audioThread->terminate();
qDebug() << "Deleting Audio";
audioThread->exit(0);
audioThread->wait();
if (audioThread->isRunning())
audioThread->terminate();
delete audioThread;
delete audioInLock;
delete audioOutLock;

View File

@ -84,7 +84,7 @@ Core::Core(Camera* cam, QThread *CoreThread, QString loadPath) :
}
// OpenAL init
QString outDevDescr = Settings::getInstance().getOutDev(); ;
QString outDevDescr = Settings::getInstance().getOutDev();
Audio::openOutput(outDevDescr);
QString inDevDescr = Settings::getInstance().getInDev();
Audio::openInput(inDevDescr);
@ -92,13 +92,15 @@ Core::Core(Camera* cam, QThread *CoreThread, QString loadPath) :
Core::~Core()
{
qDebug() << "Deleting Core";
clearPassword(Core::ptMain);
clearPassword(Core::ptHistory);
toxTimer->stop();
coreThread->exit(0);
qApp->processEvents();
coreThread->wait(500);
coreThread->wait();
if (coreThread->isRunning())
coreThread->terminate();

View File

@ -314,6 +314,7 @@ void Widget::updateTrayIcon()
Widget::~Widget()
{
qDebug() << "Deleting Widget";
core->saveConfiguration();
AutoUpdater::abortUpdates();
delete core;