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

Merge pull request #4694

Yuri (1):
      fix(threads): Always stop the camera device thread
This commit is contained in:
sudden6 2017-09-27 17:45:48 +02:00
commit a7af5176a5
No known key found for this signature in database
GPG Key ID: 279509B499E032B9

View File

@ -195,6 +195,11 @@ CameraSource::~CameraSource()
QWriteLocker locker{&streamMutex};
QWriteLocker locker2{&deviceMutex};
// Stop the device thread
deviceThread->exit(0);
deviceThread->wait();
delete deviceThread;
if (_isNone) {
return;
}
@ -223,10 +228,6 @@ CameraSource::~CameraSource()
// Synchronize with our stream thread
while (streamFuture.isRunning())
QThread::yieldCurrentThread();
deviceThread->exit(0);
deviceThread->wait();
delete deviceThread;
}
void CameraSource::subscribe()