Skip to content

Commit f57efa5

Browse files
authored
Add doc-string warnings for destroy() methods (#1204)
* publisher.py: add doc-string warning for destroy method Signed-off-by: Steve Peters <[email protected]> * subscription.py: add doc-string warning for destroy method Signed-off-by: Steve Peters <[email protected]> --------- Signed-off-by: Steve Peters <[email protected]>
1 parent e97c41b commit f57efa5

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

rclpy/rclpy/publisher.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,12 @@ def handle(self):
8888
return self.__publisher
8989

9090
def destroy(self):
91+
"""
92+
Destroy a container for a ROS publisher.
93+
94+
.. warning:: Users should not destroy a publisher with this method, instead they should
95+
call :meth:`.Node.destroy_publisher`.
96+
"""
9197
for handler in self.event_handlers:
9298
handler.destroy()
9399
self.__publisher.destroy_when_not_in_use()

rclpy/rclpy/subscription.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,12 @@ def handle(self):
8686
return self.__subscription
8787

8888
def destroy(self):
89+
"""
90+
Destroy a container for a ROS subscription.
91+
92+
.. warning:: Users should not destroy a subscription with this method, instead they
93+
should call :meth:`.Node.destroy_subscription`.
94+
"""
8995
for handler in self.event_handlers:
9096
handler.destroy()
9197
self.handle.destroy_when_not_in_use()

0 commit comments

Comments
 (0)