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:
parent
d35ebb22f0
commit
6e1484252a
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -314,6 +314,7 @@ void Widget::updateTrayIcon()
|
|||
|
||||
Widget::~Widget()
|
||||
{
|
||||
qDebug() << "Deleting Widget";
|
||||
core->saveConfiguration();
|
||||
AutoUpdater::abortUpdates();
|
||||
delete core;
|
||||
|
|
Loading…
Reference in New Issue
Block a user