Browse Source

Merge pull request #4694

Yuri (1):
      fix(threads): Always stop the camera device thread
reviewable/pr4697/r1
sudden6 8 years ago
parent
commit
a7af5176a5
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
  1. 9
      src/video/camerasource.cpp

9
src/video/camerasource.cpp

@ -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…
Cancel
Save