mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Grid calculations: Free memory after data has been read
When data has been read for a variable, free the related data to make sure the memory footprint is as low as possible.
This commit is contained in:
@@ -742,10 +742,14 @@ void RigCaseCellResultsData::freeAllocatedResultsData( std::vector<RiaDefines::R
|
||||
}
|
||||
|
||||
auto& dataForTimeStep = m_cellScalarResults[resultIdx][index];
|
||||
// Using swap with an empty vector as that is the safest way to really get rid of the allocated data in a
|
||||
// vector
|
||||
std::vector<double> empty;
|
||||
dataForTimeStep.swap( empty );
|
||||
|
||||
if ( !dataForTimeStep.empty() )
|
||||
{
|
||||
// Using swap with an empty vector as that is the safest way to really get rid of the allocated data in a
|
||||
// vector
|
||||
std::vector<double> empty;
|
||||
dataForTimeStep.swap( empty );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user