mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-09 23:16:00 -06:00
#3992 Fixed memory overwrite (and arbitrary crashes) due to missing critical section.
The critical section is needed when doing geometry transfer from libecl in paralell. Caused arbitrary crashes in completely unrelated code when compiled in release on a 32-core machine on windows
This commit is contained in:
parent
49a6650e77
commit
b329f3acc7
@ -94,9 +94,12 @@ void RigActiveCellInfo::setCellResultIndex(size_t reservoirCellIndex, size_t res
|
||||
|
||||
m_cellIndexToResultIndex[reservoirCellIndex] = reservoirCellResultIndex;
|
||||
|
||||
if (reservoirCellResultIndex >= m_reservoirCellResultCount)
|
||||
#pragma omp critical
|
||||
{
|
||||
m_reservoirCellResultCount = reservoirCellResultIndex + 1;
|
||||
if ( reservoirCellResultIndex >= m_reservoirCellResultCount )
|
||||
{
|
||||
m_reservoirCellResultCount = reservoirCellResultIndex + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user