Fix memory error during EclipseGrid creation with Actnum.

We pass an int pointer to the function initCornerPointGrid.
With ACTNUM  this pointer was initialized with data pointer
of an int vector that we threw away before the function call
(otherwise it was null). To fix this we move the int-vector up one
scope.
This commit is contained in:
Markus Blatt
2019-10-17 18:36:56 +02:00
parent a0d5776eb9
commit a3daeb9c45

View File

@@ -1150,10 +1150,11 @@ EclipseGrid::EclipseGrid(const Deck& deck, const int * actnum)
const std::vector<double>& coord = COORDKeyWord.getSIDoubleData();
int * actnum = nullptr;
std::vector<int> actnumVector;
if (deck.hasKeyword<ParserKeywords::ACTNUM>()) {
const auto& actnumKeyword = deck.getKeyword<ParserKeywords::ACTNUM>();
std::vector<int> actnumVector = actnumKeyword.getIntData();
actnumVector = actnumKeyword.getIntData();
actnum=actnumVector.data();
}