diff --git a/src/ds/d400/d400-device.cpp b/src/ds/d400/d400-device.cpp index dd8c5b9c95..c7a4a89b1e 100644 --- a/src/ds/d400/d400-device.cpp +++ b/src/ds/d400/d400-device.cpp @@ -683,7 +683,7 @@ namespace librealsense "Generate trigger from the camera to external device once per frame")); depth_sensor.register_option(RS2_OPTION_ASIC_TEMPERATURE, - std::make_shared(std::make_shared(raw_depth_sensor), + std::make_shared(std::dynamic_pointer_cast(raw_depth_sensor.shared_from_this()), RS2_OPTION_ASIC_TEMPERATURE)); // D457 dev - get_xu fails for D457 - error polling id not defined @@ -1300,7 +1300,7 @@ namespace librealsense std::vector{0.f, 2.f}, 1.f)); depth_ep.register_option(RS2_OPTION_PROJECTOR_TEMPERATURE, - std::make_shared(std::make_shared(depth_ep), + std::make_shared(std::dynamic_pointer_cast(depth_ep.shared_from_this()), RS2_OPTION_PROJECTOR_TEMPERATURE)); } } diff --git a/src/ds/ds-active-common.cpp b/src/ds/ds-active-common.cpp index d9828bdace..6fbef2747d 100644 --- a/src/ds/ds-active-common.cpp +++ b/src/ds/ds-active-common.cpp @@ -73,7 +73,7 @@ namespace librealsense else { _depth_ep.register_option(RS2_OPTION_PROJECTOR_TEMPERATURE, - std::make_shared(std::make_shared(_raw_depth_ep), + std::make_shared(std::dynamic_pointer_cast(_raw_depth_ep.shared_from_this()), RS2_OPTION_PROJECTOR_TEMPERATURE)); } } diff --git a/src/ds/ds-options.cpp b/src/ds/ds-options.cpp index 4472798d1b..3c379f95cf 100644 --- a/src/ds/ds-options.cpp +++ b/src/ds/ds-options.cpp @@ -128,8 +128,8 @@ namespace librealsense } } - asic_and_projector_temperature_options::asic_and_projector_temperature_options(std::shared_ptr ep, rs2_option opt) - : _option(opt), _ep(ep) + asic_and_projector_temperature_options::asic_and_projector_temperature_options(std::shared_ptr && ep, rs2_option opt) + : _option(opt), _ep(std::move(ep)) {} float motion_module_temperature_option::query() const diff --git a/src/ds/ds-options.h b/src/ds/ds-options.h index 9c10ac4988..b599cba1ec 100644 --- a/src/ds/ds-options.h +++ b/src/ds/ds-options.h @@ -31,7 +31,7 @@ namespace librealsense const char* get_description() const override; - explicit asic_and_projector_temperature_options(std::shared_ptr ep, rs2_option opt); + explicit asic_and_projector_temperature_options(std::shared_ptr && ep, rs2_option opt); private: std::weak_ptr _ep;