rst-tu-dortmund / costmap_converter

A ros package that includes plugins and nodes to convert occupied costmap2d cells to primitive types
138 stars 106 forks source link

Assign nullptr to spin_thread_ after deletion #30

Closed NiPeter closed 3 years ago

NiPeter commented 3 years ago

In class BaseCostmapToPolygons, spinthread pointer variable is used to check if thread should be stopped and join. After deletion in stopWorker ptr was never set to nullptr, so second call to stopWorker blocks forever. This bug prevent TEB planner from being used in lifecycle node, because BaseCostmapToPolygons cannot be stopped then destructed.

Solution is to set spinthread to null after deletion. In future, it will be more reliable to use smart pointers instead of raw.

NiPeter commented 3 years ago

Duplicate #27. Sorry for that