mirror of
https://github.com/orbbec/OrbbecSDK_ROS2.git
synced 2026-09-12 19:20:20 +08:00
clean shm
This commit is contained in:
@@ -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 ()
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user