diff --git a/engine/cpp/Controller/Engine.cpp b/engine/cpp/Controller/Engine.cpp index c3d180377ca58dab8d96f5639402271a2fbf90e7..e979467088505d29097f67e11b93d38d1d83f65e 100644 --- a/engine/cpp/Controller/Engine.cpp +++ b/engine/cpp/Controller/Engine.cpp @@ -284,7 +284,7 @@ bool PulseEngine::LoadState(const google::protobuf::Message& state, const SEScal std::unique_ptr PulseEngine::SaveState(const std::string& filename) { - std::unique_ptr state(new pulse::StateData()); + pulse::StateData* state = new pulse::StateData(); state->set_airwaymode(m_AirwayMode); state->set_intubation(m_Intubation); @@ -336,7 +336,8 @@ std::unique_ptr PulseEngine::SaveState(const std::str ascii_ostream.close(); } - return state; + std::unique_ptr msg(state); + return msg; } bool PulseEngine::InitializeEngine(const std::string& patientFile, const std::vector* conditions, const SEEngineConfiguration* config)