mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-10-12 23:39:50 +08:00
fix: correct use-after-free race causing frequent SIGSEGV when using the toggle_color/depth services (#208)
* fix: correct use-after-free race causing frequent SIGSEGV when using the toggle_color/depth services (cherry picked from commit 2d59a581a82b81088971dccda353b96a527ee681) * fix: add interleave_frame_enable handling in toggleSensor Introduce interleave_frame_enable variable to manage frame interleaving during sensor toggling. Signed-off-by: obshenlanzhou <[email protected]> --------- Signed-off-by: obshenlanzhou <[email protected]> Co-authored-by: obshenlanzhou <[email protected]>
This commit is contained in:
co-authored by
obshenlanzhou
parent
549965ccbc
commit
f39a27fbc1
@@ -1940,7 +1940,11 @@ bool OBCameraNode::toggleSensor(const stream_index_pair& stream_index, bool enab
|
|||||||
std::string& msg) {
|
std::string& msg) {
|
||||||
std::lock_guard<decltype(device_lock_)> lock(device_lock_);
|
std::lock_guard<decltype(device_lock_)> lock(device_lock_);
|
||||||
try {
|
try {
|
||||||
pipeline_->stop();
|
const bool interleave_frame_enable = interleave_frame_enable_;
|
||||||
|
stopStreams();
|
||||||
|
interleave_frame_enable_ = interleave_frame_enable;
|
||||||
|
stopColorFrameThreads();
|
||||||
|
clearColorFrameQueues();
|
||||||
enable_stream_[stream_index] = enabled;
|
enable_stream_[stream_index] = enabled;
|
||||||
setupProfiles();
|
setupProfiles();
|
||||||
startStreams();
|
startStreams();
|
||||||
|
|||||||
Reference in New Issue
Block a user