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:
commit
a7af5176a5
|
@ -195,6 +195,11 @@ CameraSource::~CameraSource()
|
||||||
QWriteLocker locker{&streamMutex};
|
QWriteLocker locker{&streamMutex};
|
||||||
QWriteLocker locker2{&deviceMutex};
|
QWriteLocker locker2{&deviceMutex};
|
||||||
|
|
||||||
|
// Stop the device thread
|
||||||
|
deviceThread->exit(0);
|
||||||
|
deviceThread->wait();
|
||||||
|
delete deviceThread;
|
||||||
|
|
||||||
if (_isNone) {
|
if (_isNone) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -223,10 +228,6 @@ CameraSource::~CameraSource()
|
||||||
// Synchronize with our stream thread
|
// Synchronize with our stream thread
|
||||||
while (streamFuture.isRunning())
|
while (streamFuture.isRunning())
|
||||||
QThread::yieldCurrentThread();
|
QThread::yieldCurrentThread();
|
||||||
|
|
||||||
deviceThread->exit(0);
|
|
||||||
deviceThread->wait();
|
|
||||||
delete deviceThread;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CameraSource::subscribe()
|
void CameraSource::subscribe()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user