diff --git a/orbbec_camera/CMakeLists.txt b/orbbec_camera/CMakeLists.txt index e962d45b..faeee2f8 100644 --- a/orbbec_camera/CMakeLists.txt +++ b/orbbec_camera/CMakeLists.txt @@ -153,12 +153,6 @@ install(DIRECTORY if (BUILD_TESTING) find_package(ament_lint_auto REQUIRED) - # the following line skips the linter which checks for copyrights - # uncomment the line when a copyright and license is not present in all source files - #set(ament_cmake_copyright_FOUND TRUE) - # the following line skips cpplint (only works in a git repo) - # uncomment the line when this package is not in a git repo - #set(ament_cmake_cpplint_FOUND TRUE) ament_lint_auto_find_test_dependencies() endif () diff --git a/orbbec_camera/src/ob_camera_node_factory.cpp b/orbbec_camera/src/ob_camera_node_factory.cpp index ea08a191..2b53e40e 100644 --- a/orbbec_camera/src/ob_camera_node_factory.cpp +++ b/orbbec_camera/src/ob_camera_node_factory.cpp @@ -35,6 +35,11 @@ OBCameraNodeFactory::OBCameraNodeFactory(const std::string &node_name, const std OBCameraNodeFactory::~OBCameraNodeFactory() { is_alive_.store(false); + sem_unlink(DEFAULT_SEM_NAME.c_str()); + int shm_id = shmget(DEFAULT_SEM_KEY, 1, 0666 | IPC_CREAT); + if (shm_id != -1) { + shmctl(shm_id, IPC_RMID, nullptr); + } if (query_thread_ && query_thread_->joinable()) { query_thread_->join(); }