From a4be4514c9206355af120106e00c18eca8b5d75a Mon Sep 17 00:00:00 2001 From: frosch Date: Sun, 12 Jan 2020 17:23:04 +0100 Subject: Fix #7925: Reset temporary saveload data at the start of loading a savegame instead of at the end. Otherwise temporary data may be passed from an aborted load action to the next load action. --- src/saveload/engine_sl.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/saveload/engine_sl.cpp') diff --git a/src/saveload/engine_sl.cpp b/src/saveload/engine_sl.cpp index 4ba38d04b..44ba6498e 100644 --- a/src/saveload/engine_sl.cpp +++ b/src/saveload/engine_sl.cpp @@ -140,6 +140,11 @@ void CopyTempEngineData() if (se->name != nullptr) e->name = stredup(se->name); } + ResetTempEngineData(); +} + +void ResetTempEngineData() +{ /* Get rid of temporary data */ for (std::vector::iterator it = _temp_engine.begin(); it != _temp_engine.end(); ++it) { FreeEngine(*it); -- cgit v1.2.3-54-g00ecf