File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
rclcpp_action/include/rclcpp_action Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -368,21 +368,23 @@ class Client : public ClientBase
368368 // Do not use std::make_shared as friendship cannot be forwarded.
369369 std::shared_ptr<GoalHandle> goal_handle (
370370 new GoalHandle (goal_info, options.feedback_callback , options.result_callback ));
371+ {
372+ std::lock_guard<std::mutex> guard (goal_handles_mutex_);
373+ goal_handles_[goal_handle->get_goal_id ()] = goal_handle;
374+ }
375+ promise->set_value (goal_handle);
376+ if (options.goal_response_callback ) {
377+ options.goal_response_callback (future);
378+ }
379+
371380 if (options.result_callback ) {
372381 try {
373382 this ->make_result_aware (goal_handle);
374383 } catch (...) {
375384 promise->set_exception (std::current_exception ());
376- options.goal_response_callback (future);
377385 return ;
378386 }
379387 }
380- std::lock_guard<std::mutex> guard (goal_handles_mutex_);
381- goal_handles_[goal_handle->get_goal_id ()] = goal_handle;
382- promise->set_value (goal_handle);
383- if (options.goal_response_callback ) {
384- options.goal_response_callback (future);
385- }
386388 });
387389 return future;
388390 }
You can’t perform that action at this time.
0 commit comments