File tree 1 file changed +4
-0
lines changed
localization/ndt_scan_matcher/src
1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ void MapUpdateModule::update_map(const geometry_msgs::msg::Point & position)
70
70
// lock and rebuild ndt_ptr_
71
71
if (need_rebuild_) {
72
72
ndt_ptr_mutex_->lock ();
73
+
73
74
auto param = ndt_ptr_->getParams ();
74
75
auto input_source = ndt_ptr_->getInputSource ();
75
76
@@ -90,10 +91,13 @@ void MapUpdateModule::update_map(const geometry_msgs::msg::Point & position)
90
91
update_ndt (position, *secondary_ndt_ptr_);
91
92
92
93
ndt_ptr_mutex_->lock ();
94
+ auto dummy_ptr = ndt_ptr_;
93
95
auto input_source = ndt_ptr_->getInputSource ();
94
96
ndt_ptr_ = secondary_ndt_ptr_;
95
97
ndt_ptr_->setInputSource (input_source);
96
98
ndt_ptr_mutex_->unlock ();
99
+
100
+ dummy_ptr.reset ();
97
101
}
98
102
99
103
secondary_ndt_ptr_.reset (new NdtType);
You can’t perform that action at this time.
0 commit comments