Skip to content

Commit b5fb100

Browse files
committed
vtd: Fix potential bug in vehicle creation
1 parent f1c5f1f commit b5fb100

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

optional/vtd/src/vtd_vehicle.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ class VtdVehicleFactory {
307307

308308
void set_task_control(std::shared_ptr<TaskControl> tc) { task_control_ = tc; }
309309

310-
std::shared_ptr<VtdVehicle> create_or_throw(ScpTransceiver& tx, int id, std::string&& name,
310+
std::shared_ptr<VtdVehicle> create_or_throw(ScpTransceiver& tx, int id, const std::string& name,
311311
cloe::AbortFlag& sig) {
312312
assert(task_control_);
313313
assert(sensor_port_ != 0);
@@ -329,7 +329,7 @@ class VtdVehicleFactory {
329329

330330
// Put it all together in form of a vehicle.
331331
std::shared_ptr<VtdVehicle> veh =
332-
std::make_shared<VtdVehicle>(id, std::move(name), std::move(rdb_client), task_control_);
332+
std::make_shared<VtdVehicle>(id, name, std::move(rdb_client), task_control_);
333333

334334
// Create and register additional configured sensors
335335
if (vehicles_.count(name)) {

0 commit comments

Comments
 (0)