Skip to content

Commit 0603706

Browse files
committed
style: rename __del__ to shutdown
1 parent b80575a commit 0603706

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/rai/rai/communication/ros2/api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ def _verify_publisher_exists(self, topic: str) -> List[TopicEndpointInfo]:
305305
raise ValueError(f"No publisher found for topic: {topic}")
306306
return topic_endpoints
307307

308-
def __del__(self) -> None:
308+
def shutdown(self) -> None:
309309
"""Cleanup publishers when object is destroyed."""
310310
for publisher in self._publishers.values():
311311
publisher.destroy()
@@ -480,7 +480,7 @@ def get_result(self, handle: str) -> Any:
480480
raise ValueError(f"No result available for goal {handle}")
481481
return self.actions[handle]["result_future"].result()
482482

483-
def __del__(self) -> None:
483+
def shutdown(self) -> None:
484484
"""Cleanup thread pool when object is destroyed."""
485485
if hasattr(self, "_callback_executor"):
486486
self._callback_executor.shutdown(wait=False)

src/rai/rai/communication/ros2/connectors.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,4 +119,6 @@ def shutdown(self):
119119
def _cleanup(self):
120120
self._executor.shutdown()
121121
self._thread.join()
122+
self._actions_api.shutdown()
123+
self._topic_api.shutdown()
122124
self._node.destroy_node()

0 commit comments

Comments
 (0)