From ce26437130c6a702784632065bf7b3c109c68b17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Jensen?= Date: Thu, 4 Oct 2018 10:40:48 +0200 Subject: [PATCH] #3452 Command execution. Clear cached data before executing new commands --- .../CommandFileInterface/RicfCommandFileExecutor.cpp | 11 +++++++++++ .../CommandFileInterface/RicfCommandFileExecutor.h | 2 ++ 2 files changed, 13 insertions(+) diff --git a/ApplicationCode/CommandFileInterface/RicfCommandFileExecutor.cpp b/ApplicationCode/CommandFileInterface/RicfCommandFileExecutor.cpp index 2541da5f17..d2cacf7201 100644 --- a/ApplicationCode/CommandFileInterface/RicfCommandFileExecutor.cpp +++ b/ApplicationCode/CommandFileInterface/RicfCommandFileExecutor.cpp @@ -61,6 +61,8 @@ void RicfCommandFileExecutor::executeCommands(QTextStream& stream) RicfMessages messages; std::vector executableCommands; { + clearCachedData(); + std::vector fileCommands = RicfCommandFileReader::readCommands(stream, caf::PdmDefaultObjectFactory::instance(), &messages); for (auto message : messages.m_messages) { @@ -214,3 +216,12 @@ std::vector RicfCommandFileExecutor::prepareFileCommandsForE return executableCommands; } + +//-------------------------------------------------------------------------------------------------- +/// +//-------------------------------------------------------------------------------------------------- +void RicfCommandFileExecutor::clearCachedData() +{ + m_exportPaths.clear(); + m_lastProjectPath.clear(); +} diff --git a/ApplicationCode/CommandFileInterface/RicfCommandFileExecutor.h b/ApplicationCode/CommandFileInterface/RicfCommandFileExecutor.h index a2089199dd..b6efa79d9c 100644 --- a/ApplicationCode/CommandFileInterface/RicfCommandFileExecutor.h +++ b/ApplicationCode/CommandFileInterface/RicfCommandFileExecutor.h @@ -60,6 +60,8 @@ public: static std::vector prepareFileCommandsForExecution(const std::vector& commandsReadFromFile); private: + void clearCachedData(); + std::map m_exportPaths; QString m_lastProjectPath; };