ros2-java / ros2_java

Java and Android bindings for ROS2
Apache License 2.0
172 stars 93 forks source link

clear node/context handle on RclJava.cleanup() #130

Closed sung-goo-kim closed 4 years ago

sung-goo-kim commented 4 years ago

node and context handle should remove from list(LinkedBlockingQueue) when after dispose() called.

If RCLJava.cleanup() called multiple times without terminating the program, unexpected problems may occur due to uncleared nodes.

esteve commented 4 years ago

@sung-goo-kim thanks! It looks like services, subscriptions and publishers should be cleared as well, what do you think? Thanks again.

sung-goo-kim commented 4 years ago

@sung-goo-kim thanks! It looks like services, subscriptions and publishers should be cleared as well, what do you think? Thanks again.

@esteve thanks for comment. I added commit to clear publishers, subscribers, clients, services and timers when disposing node.

esteve commented 4 years ago

@sung-goo-kim thanks and sorry it took so long to merge this change