Skip to content

Commit

Permalink
fix(goal_planner): fixed goal memory leak (#5381)
Browse files Browse the repository at this point in the history
Signed-off-by: kosuke55 <[email protected]>
  • Loading branch information
kosuke55 authored Oct 23, 2023
1 parent 69813cb commit 20c0d15
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,6 @@ class PullOverStatus
DEFINE_SETTER_GETTER(std::vector<PullOverPath>, pull_over_path_candidates)
DEFINE_SETTER_GETTER(std::optional<Pose>, closest_start_pose)

void push_goal_candidate(const GoalCandidate & goal_candidate)
{
std::lock_guard<std::mutex> lock(mutex_);
goal_candidates_.push_back(goal_candidate);
}

private:
std::shared_ptr<PullOverPath> pull_over_path_{nullptr};
std::shared_ptr<PullOverPath> lane_parking_pull_over_path_{nullptr};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,9 @@ void GoalPlannerModule::generateGoalCandidates()
GoalCandidate goal_candidate{};
goal_candidate.goal_pose = goal_pose;
goal_candidate.distance_from_original_goal = 0.0;
status_.push_goal_candidate(goal_candidate);
GoalCandidates goal_candidates{};
goal_candidates.push_back(goal_candidate);
status_.set_goal_candidates(goal_candidates);
}
}

Expand Down

0 comments on commit 20c0d15

Please sign in to comment.