ros-drivers / transport_drivers

A set of ROS2 drivers for transport-layer protocols.
Apache License 2.0
92 stars 56 forks source link

Check if port is open before closing in destructor #89

Closed sven-hoek closed 1 year ago

sven-hoek commented 1 year ago

As mentioned in https://github.com/ros-drivers/transport_drivers/issues/87, the fix to close the port in case of an error leads to the destructor trying to close it even though it has already been closed. As a simple solution, in the destructor we check, whether the port is still open or not.

Note: I forgot to pull changes first and had some mistakes in the first pull request, you can ignore it.

moriarty commented 1 year ago

Looks like this PR wasn't automatically assigned any reviewers.

Tagging @esteve & @JWhitleyWork because they've reviewed and merged similar PRs and might get notified if tagged.