Commit cc4b0ff3 authored by David Partyka's avatar David Partyka
Browse files

Merge branch '11982-memory-leaks' into release

parents 561b04fd 67941d51
......@@ -212,6 +212,30 @@ extern "C" { typedef int (*vtkExodusIIGetMapFunc)( int, int* ); }
#include "vtkExodusIIReaderPrivate.h"
#include "vtkExodusIIReaderVariableCheck.h"
// --------------------------------------------------- PRIVATE CLASS Implementations
vtkExodusIIReaderPrivate::BlockSetInfoType::BlockSetInfoType(
const vtkExodusIIReaderPrivate::BlockSetInfoType &block):
vtkExodusIIReaderPrivate::ObjectInfoType(block),
FileOffset(block.FileOffset),
PointMap(block.PointMap),
ReversePointMap(block.ReversePointMap),
CachedConnectivity(0)
{
//this is needed to properly manage memory.
//when vectors are resized or reserved the container
//might be copied to a memory spot, so we need a proper copy constructor
//so that the cache remains valid
this->CachedConnectivity = block.CachedConnectivity;
}
vtkExodusIIReaderPrivate::BlockSetInfoType::~BlockSetInfoType()
{
if (this->CachedConnectivity)
{
this->CachedConnectivity->Delete();
}
}
// ----------------------------------------------------------- UTILITY ROUTINES
// This function exists because FORTRAN ordering sucks.
......
......@@ -357,7 +357,9 @@ public:
/// Cached cell connectivity arrays for mesh
vtkUnstructuredGrid* CachedConnectivity;
BlockSetInfoType() { this->CachedConnectivity = 0; }
BlockSetInfoType(){this->CachedConnectivity=0;}
BlockSetInfoType(const BlockSetInfoType& block);
~BlockSetInfoType();
};
/// A struct to hold information about Exodus blocks
......@@ -374,7 +376,7 @@ public:
int CellType;
// Number of points per cell as used by VTK
// -- not what's in the file (i.e., BdsPerEntry[0] >= PointsPerCell)
int PointsPerCell;
int PointsPerCell;
};
/// A struct to hold information about Exodus blocks
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment