diff --git a/src/uvc-sensor.h b/src/uvc-sensor.h index ad2c5938d04..911570520ad 100644 --- a/src/uvc-sensor.h +++ b/src/uvc-sensor.h @@ -46,8 +46,12 @@ class uvc_sensor : public raw_sensor_base void power_for_duration( std::chrono::steady_clock::duration timeout = std::chrono::milliseconds( 500 ) ) { - acquire_power(); std::weak_ptr< uvc_sensor > weak = std::dynamic_pointer_cast< uvc_sensor >( shared_from_this() ); + if( auto strong = weak.lock() ) + { + strong->acquire_power(); + } + std::thread release_power_thread( [weak, timeout]() { std::this_thread::sleep_for( timeout ); diff --git a/unit-tests/live/d400/test-hdr-long.py b/unit-tests/live/d400/test-hdr-long.py index fa8a9424f37..050cf96bbfb 100644 --- a/unit-tests/live/d400/test-hdr-long.py +++ b/unit-tests/live/d400/test-hdr-long.py @@ -357,6 +357,10 @@ def check_sequence_id(pipe): if test.check(at_least_one_frame_supported_seq_id): test.check(first_series_last_merged_ts != -1) test.check(depth_sensor.get_option(rs.option.hdr_enabled) == 1) + print("cfg1 = ", cfg) + cfg = rs.config() + cfg.enable_stream(rs.stream.depth) + print("cfg2 = ", cfg) pipe.start(cfg) for i in range(0, 10):