diff --git a/dummies/helperFactory.cpp b/dummies/helperFactory.cpp index 6cd78f93..cbe979bf 100644 --- a/dummies/helperFactory.cpp +++ b/dummies/helperFactory.cpp @@ -192,9 +192,8 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio new Max31865Dummy(objects::RTD_15_IC18_IMTQ, objects::DUMMY_COM_IF, comCookieDummy)); std::optional tmpSensorDummies; - TemperatureSensorInserter::Tmp1075DummyMap tmpDummyMap; if (cfg.addTmpDummies) { - tmpSensorDummies = tmpDummyMap; + TemperatureSensorInserter::Tmp1075DummyMap tmpDummyMap; if (cfg.tmp1075Cfg.addTcsBrd0) { tmpDummyMap.emplace(objects::TMP1075_HANDLER_TCS_0, new Tmp1075Dummy(objects::TMP1075_HANDLER_TCS_0, objects::DUMMY_COM_IF, @@ -220,6 +219,7 @@ void dummy::createDummies(DummyCfg cfg, PowerSwitchIF& pwrSwitcher, GpioIF* gpio new Tmp1075Dummy(objects::TMP1075_HANDLER_IF_BOARD, objects::DUMMY_COM_IF, comCookieDummy)); } + tmpSensorDummies = std::move(tmpDummyMap); } new TemperatureSensorInserter(objects::THERMAL_TEMP_INSERTER, rtdSensorDummies, tmpSensorDummies);