From 4a23440aaa3bf2a9a2eb9ffd204d3aa45b192121 Mon Sep 17 00:00:00 2001 From: Victor Lopez Date: Mon, 9 May 2022 13:43:12 +0200 Subject: [PATCH] Workaround for https://github.com/IntelRealSense/librealsense/issues/10482 --- src/context.h | 6 ++++++ src/device.cpp | 1 + 2 files changed, 7 insertions(+) diff --git a/src/context.h b/src/context.h index 1945a2dc5f..ed09ca12e5 100644 --- a/src/context.h +++ b/src/context.h @@ -129,6 +129,12 @@ namespace librealsense void add_software_device(std::shared_ptr software_device); + void stop_device_watcher() + { + if (!_device_watcher->is_stopped()) + _device_watcher->stop(); + } + #if WITH_TRACKING void unload_tracking_module(); #endif diff --git a/src/device.cpp b/src/device.cpp index e1927cbe0c..d9c73467cd 100644 --- a/src/device.cpp +++ b/src/device.cpp @@ -195,6 +195,7 @@ device::device(std::shared_ptr ctx, device::~device() { + _context->stop_device_watcher(); if (_device_changed_notifications) { _context->unregister_internal_device_callback(_callback_id);