Unity-Technologies / ROS-TCP-Connector

Apache License 2.0
287 stars 90 forks source link

ROSConnection leaves the connectionthread running after destruction #289

Closed antsa123 closed 2 years ago

antsa123 commented 2 years ago

Describe the bug

When an instance of ROSConnection is destroyed the connection thread stays alive in the background.

To Reproduce

  1. Create a gameobject that can be destroyed easily in either editor session or by pressing a key.
  2. Make ROSConnection a child of this game object. Set show HUD true.
  3. Start game. Connect to a ROS2 TCP Endpoint.
  4. Destroy the gameobject created in step 1.
  5. Notice how the connection is still alive in the HUD.

Expected behavior

I would expect that when the ROSConnection is destroyed also all dangling threads or tasks are automatically stopped and cleaned up.

Environment (please complete the following information, where applicable):