Skip to content

Conversation

@Prathmesh2931
Copy link

The async methods previously captured stack variables by reference in callbacks. When the method returned, those variables were destroyed, causing use-after-free and memory corruption. The fix moves this state to heap-allocated shared objects captured by value, ensuring safe lifetime.
Mutex-protected goal handle members were added so the class can properly track, synchronize, and cancel active goals, restoring the ability to query action state similar to ROS1.

… handles

Replace stack-captured state in plan(), move(), and execute() with heap-shared state captured by value in callbacks to avoid use-after-free when async methods return.

Add mutex-protected `active_move_goal_handle_` and `active_execute_goal_handle_` members and cancel active goals in the destructor. Include <mutex> and <atomic>.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant