diff --git a/rclpy/rclpy/publisher.py b/rclpy/rclpy/publisher.py index 4cd288e05..34863c296 100644 --- a/rclpy/rclpy/publisher.py +++ b/rclpy/rclpy/publisher.py @@ -88,6 +88,12 @@ def handle(self): return self.__publisher def destroy(self): + """ + Destroy a container for a ROS publisher. + + .. warning:: Users should not destroy a publisher with this method, instead they should + call :meth:`.Node.destroy_publisher`. + """ for handler in self.event_handlers: handler.destroy() self.__publisher.destroy_when_not_in_use() diff --git a/rclpy/rclpy/subscription.py b/rclpy/rclpy/subscription.py index ac3b1d59a..9f993a147 100644 --- a/rclpy/rclpy/subscription.py +++ b/rclpy/rclpy/subscription.py @@ -86,6 +86,12 @@ def handle(self): return self.__subscription def destroy(self): + """ + Destroy a container for a ROS subscription. + + .. warning:: Users should not destroy a subscription with this method, instead they + should call :meth:`.Node.destroy_subscription`. + """ for handler in self.event_handlers: handler.destroy() self.handle.destroy_when_not_in_use()