Skip to content

Commit 9d91137

Browse files
0x126yukkysaito
andauthored
fix(tier4_planning_rviz_plugin): memory leak (autowarefoundation#7164) (#1507)
fix memory leak Signed-off-by: Yukihito Saito <yukky.saito@gmail.com> Co-authored-by: Yukihiro Saito <yukky.saito@gmail.com>
1 parent cd1e5db commit 9d91137

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

common/tier4_planning_rviz_plugin/include/path/display_base.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,9 @@ class AutowarePathBaseDisplay : public rviz_common::MessageFilterDisplay<T>
315315
node->detachAllObjects();
316316
node->removeAndDestroyAllChildren();
317317
this->scene_manager_->destroySceneNode(node);
318+
319+
rviz_rendering::MovableText * text = velocity_texts_.at(i);
320+
delete text;
318321
}
319322
velocity_texts_.resize(msg_ptr->points.size());
320323
velocity_text_nodes_.resize(msg_ptr->points.size());
@@ -338,6 +341,9 @@ class AutowarePathBaseDisplay : public rviz_common::MessageFilterDisplay<T>
338341
node->detachAllObjects();
339342
node->removeAndDestroyAllChildren();
340343
this->scene_manager_->destroySceneNode(node);
344+
345+
rviz_rendering::MovableText * text = slope_texts_.at(i);
346+
delete text;
341347
}
342348
slope_texts_.resize(msg_ptr->points.size());
343349
slope_text_nodes_.resize(msg_ptr->points.size());

0 commit comments

Comments
 (0)