From 16452db789c3abfe93f43fe1a3cc0579d864b8ed Mon Sep 17 00:00:00 2001 From: Thomas Witkowski <thomas.witkowski@gmx.de> Date: Mon, 24 Nov 2008 11:51:11 +0000 Subject: [PATCH] * ? --- AMDiS/src/SolutionDataStorage.hh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/AMDiS/src/SolutionDataStorage.hh b/AMDiS/src/SolutionDataStorage.hh index 09db6a3b..4e108a41 100644 --- a/AMDiS/src/SolutionDataStorage.hh +++ b/AMDiS/src/SolutionDataStorage.hh @@ -50,6 +50,12 @@ namespace AMDiS { ERROR_EXIT("Not yet\n"); } + // If pop was the last operation, cleanup and reset the data storage. + if (poped) { + clear(); + poped = false; + } + std::vector<FiniteElemSpace*> feSpace(solution->getFESpaces().size()); for (int i = 0; i < feSpace.size(); i++) { feSpace[i] = NEW FiniteElemSpace(); @@ -65,12 +71,6 @@ namespace AMDiS { vec->interpol(solution, 1.0); memoryUsage += vec->calcMemoryUsage(); - // If pop was the last operation, cleanup and reset the data storage. - if (poped) { - clear(); - poped = false; - } - solutions.push_back(vec); timestamps.push_back(timestamp); @@ -97,7 +97,7 @@ namespace AMDiS { template<typename T> void SolutionDataStorage<T>::clear() { - for (int i = 1; i < static_cast<int>(solutions.size()); i++) { + for (int i = 0; i < static_cast<int>(solutions.size()); i++) { DELETE solutions[i]; } -- GitLab