Merge pull request #3222 from Carbenium/monitor-destr-crash

Monitor: Fix a crash when destroying a monitor (shutdown)
This commit is contained in:
Isaac Connor 2021-04-25 18:58:52 -04:00 committed by GitHub
commit 1204a23789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -3116,6 +3116,9 @@ int Monitor::PrimeCapture() {
int Monitor::PreCapture() const { return camera->PreCapture(); }
int Monitor::PostCapture() const { return camera->PostCapture(); }
int Monitor::Close() {
if (close_event_thread.joinable()) {
close_event_thread.join();
}
// Because the stream indexes may change we have to clear out the packetqueue
if (decoder) {
decoder->Stop();