Commit 54da2ae4 authored by Philipp Schäfer's avatar Philipp Schäfer
Browse files

OutdoorAcoustics WorkerThread

- bugfix, now initializes nullptr for simulator if config is not defined correctly
- now checks if simulator is set before computing
parent baf442cd
......@@ -80,6 +80,9 @@ namespace ITA
}
std::unique_ptr<ISimulatorInterface> CSimulatorFactory::CreateSimulator(const std::shared_ptr<ISimulatorInterface::SimulatorConfig>& pConfig)
{
if (!pConfig)
return nullptr;
auto it = m_mRegisteredSimulatorTypes.find(pConfig->sSimulatorType);
if (it != m_mRegisteredSimulatorTypes.end())
{
......
......@@ -68,8 +68,7 @@ namespace ITA
CWorkerThread::CWorkerThread(const WorkerThreadConfig& oConfig, ISchedulerInterface* pParent)
: IWorkerInterface(pParent), m_evTriggerLoop(VistaThreadEvent::NON_WAITABLE_EVENT)
{
auto pSimulator = CSimulatorFactory::CreateSimulator( oConfig.pSimulatorConfig );
SetSimulator( std::move( pSimulator ) );
m_pSimulator = CSimulatorFactory::CreateSimulator(oConfig.pSimulatorConfig);
Run();
}
......@@ -163,6 +162,7 @@ namespace ITA
}
assert(!m_bResetIndicated);
assert(m_pSimulator);
assert(m_pUpdate);
const unsigned int uiUpdateID = m_pUpdate->GetID();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment