Commit fc4d9d46 authored by Dave Demarle's avatar Dave Demarle
Browse files

BUG: Fix memory leaks

parent 9611cfcf
......@@ -84,7 +84,7 @@
#define USE_IMAGE_DATA // otherwise uniformgrid
vtkStandardNewMacro(vtkXdmfReader);
vtkCxxRevisionMacro(vtkXdmfReader, "1.24");
vtkCxxRevisionMacro(vtkXdmfReader, "1.25");
vtkCxxSetObjectMacro(vtkXdmfReader,Controller,vtkMultiProcessController);
......@@ -210,7 +210,22 @@ class vtkXdmfReaderActualGrid
{
public:
vtkXdmfReaderActualGrid() : Enabled(0), Grid(0), Collection(0) {}
~vtkXdmfReaderActualGrid()
{
if (this->Collection)
{
vtkXdmfReaderGridCollection::SetOfGrids::iterator it = this->Collection->Grids.begin();
while ( it != this->Collection->Grids.end() )
{
if (it->second)
{
delete it->second;
it->second = NULL;
}
it++;
}
};
}
int Enabled;
vtkXdmfReaderGrid* Grid;
vtkXdmfReaderGridCollection* Collection;
......
Supports Markdown
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