Commit 051618be authored by Yumin Yuan's avatar Yumin Yuan
Browse files

Fixed a couple VTK leaks

parent fae64dab
......@@ -180,6 +180,7 @@ Session::~Session()
++mbit;
}
}
this->m_itemWatcher->session = NULL;
this->m_itemWatcher->Delete();
if(this->m_bathymetryHelper)
{
......@@ -877,6 +878,7 @@ int Session::findOrAddUseAdjacencies(
this->addEntity(entRef, subloop, smtk::model::INCLUDES, helper);
++numEnts;
}
loopIt->Delete();
}
else
{ // we are an inner loop use.
......@@ -1945,6 +1947,7 @@ static vtkModelFaceUse* locateLoopInFace(
vtkModelLoopUse* outerLoop = refFaceUse->GetOuterLoopUse();
refLoopParent = (other == outerLoop) ? NULL : outerLoop;
faceUseOrientation = i;
loopUseIt->Delete();
return refFaceUse;
}
}
......
......@@ -24,7 +24,7 @@
#include <vtkIntArray.h>
#include <vtkPolyData.h>
#include <vtkSmartPointer.h>
#include <vtkNew.h>
vtkCMBParserBase::vtkCMBParserBase()
{
......@@ -42,13 +42,13 @@ void vtkCMBParserBase::SetGeometry(vtkDiscreteModel* Model, vtkObject* Geometry)
//So what we can do is do a CopyStructure first, and DeepCopy that
//to only deep copy the structure
vtkPolyData* copiedStructure = vtkPolyData::New();
vtkNew<vtkPolyData> copiedStructure;
copiedStructure->CopyStructure(vtkDataSet::SafeDownCast(Geometry));
vtkPolyData* deepCopy = vtkPolyData::New();
deepCopy->DeepCopy(copiedStructure);
vtkNew<vtkPolyData> deepCopy;
deepCopy->DeepCopy(copiedStructure.GetPointer());
DiscreteMesh mesh(deepCopy);
DiscreteMesh mesh(deepCopy.GetPointer());
Model->SetMesh(mesh);
}
......
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