mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#3061 Implement Memory Cleanup for eclipse data.
This commit is contained in:
@@ -632,11 +632,13 @@ void RigCaseCellResultsData::clearScalarResult(RiaDefines::ResultCatType type, c
|
||||
size_t scalarResultIndex = this->findScalarResultIndex(type, resultName);
|
||||
if (scalarResultIndex == cvf::UNDEFINED_SIZE_T) return;
|
||||
|
||||
std::vector<std::vector<double>> empty;
|
||||
m_cellScalarResults[scalarResultIndex].swap(empty);
|
||||
for (size_t tsIdx = 0; tsIdx < m_cellScalarResults[scalarResultIndex].size(); ++tsIdx)
|
||||
{
|
||||
std::vector<double> empty;
|
||||
m_cellScalarResults[scalarResultIndex][tsIdx].swap(empty);
|
||||
}
|
||||
|
||||
recalculateStatistics(scalarResultIndex);
|
||||
|
||||
//m_resultInfos[scalarResultIndex].type() = RiaDefines::REMOVED;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -674,6 +676,20 @@ void RigCaseCellResultsData::freeAllocatedResultsData()
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RigCaseCellResultsData::isResultLoaded(const RigEclipseResultInfo& resultInfo) const
|
||||
{
|
||||
size_t scalarResultIndex = this->findScalarResultIndex(resultInfo.resultType(), resultInfo.resultName());
|
||||
CVF_TIGHT_ASSERT(scalarResultIndex != cvf::UNDEFINED_SIZE_T);
|
||||
if (scalarResultIndex != cvf::UNDEFINED_SIZE_T)
|
||||
{
|
||||
return isDataPresent(scalarResultIndex);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
/// Make sure we have a result with given type and name, and make sure one "timestep" result vector
|
||||
// for the static result values are allocated
|
||||
|
||||
Reference in New Issue
Block a user