diff --git a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/MuonAnalysisDataLoader.h b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/MuonAnalysisDataLoader.h index 5c0c23eacc11..facb4860a384 100644 --- a/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/MuonAnalysisDataLoader.h +++ b/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/Muon/MuonAnalysisDataLoader.h @@ -95,6 +95,8 @@ class MANTIDQT_CUSTOMINTERFACES_DLL MuonAnalysisDataLoader { /// Load dead times from file Mantid::API::Workspace_sptr loadDeadTimesFromFile(const std::string &filename) const; + // empty the cache + void clearCache(); protected: /// Set properties of algorithm from options diff --git a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp index b4dd30338ab2..5001f39717e9 100644 --- a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp +++ b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysis.cpp @@ -2694,7 +2694,7 @@ void MuonAnalysis::doSetToolbarsHidden(bool hidden) { */ void MuonAnalysis::onDeadTimeTypeChanged(int choice) { m_deadTimesChanged = true; - + m_dataLoader.clearCache(); if (choice == 0 || choice == 1) // if choice == none || choice == from file { m_uiForm.mwRunDeadTimeFile->setVisible(false); @@ -2757,6 +2757,7 @@ void MuonAnalysis::deadTimeFileSelected() { * from the form */ void MuonAnalysis::setTimeZeroState(int checkBoxState) { + m_dataLoader.clearCache(); if (checkBoxState == -1) checkBoxState = m_uiForm.timeZeroAuto->checkState(); @@ -2778,6 +2779,7 @@ void MuonAnalysis::setTimeZeroState(int checkBoxState) { * from the form */ void MuonAnalysis::setFirstGoodDataState(int checkBoxState) { + m_dataLoader.clearCache(); if (checkBoxState == -1) checkBoxState = m_uiForm.firstGoodDataAuto->checkState(); diff --git a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisDataLoader.cpp b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisDataLoader.cpp index c8c5914ab134..7ce7bebaa575 100644 --- a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisDataLoader.cpp +++ b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisDataLoader.cpp @@ -472,5 +472,11 @@ void MuonAnalysisDataLoader::updateCache() const { } } +void MuonAnalysisDataLoader::clearCache() { + if (!m_loadedDataCache.empty()) { + m_loadedDataCache.clear(); + } +} + } // namespace CustomInterfaces } // namespace MantidQt