Commit a95af1ba authored by Andrew Bauer's avatar Andrew Bauer
Browse files

Fix memory leak

VTK objects were just being set to nullptr instead of properly
getting deleted.
parent bb00c3da
Pipeline #207253 running with stage
......@@ -416,11 +416,15 @@ void vtkTransformConcatenation::Concatenate(vtkAbstractTransform* trans)
// into the concatenation from their position at the end
if (this->PreMultiplyFlag && this->PreMatrix)
{
this->PreMatrix->Delete();
this->PreMatrixTransform->Delete();
this->PreMatrix = nullptr;
this->PreMatrixTransform = nullptr;
}
else if (!this->PreMultiplyFlag && this->PostMatrix)
{
this->PostMatrix->Delete();
this->PostMatrixTransform->Delete();
this->PostMatrix = nullptr;
this->PostMatrixTransform = nullptr;
}
......@@ -633,11 +637,26 @@ void vtkTransformConcatenation::Inverse()
void vtkTransformConcatenation::Identity()
{
// forget the Pre- and PostMatrix
this->PreMatrix = nullptr;
this->PostMatrix = nullptr;
this->PreMatrixTransform = nullptr;
this->PostMatrixTransform = nullptr;
if (this->PreMatrix)
{
this->PreMatrix->Delete();
this->PreMatrix = nullptr;
}
if (this->PostMatrix)
{
this->PostMatrix->Delete();
this->PostMatrix = nullptr;
}
if (this->PreMatrixTransform)
{
this->PreMatrixTransform->Delete();
this->PreMatrixTransform = nullptr;
}
if (this->PostMatrixTransform)
{
this->PostMatrixTransform->Delete();
this->PostMatrixTransform = nullptr;
}
// delete all the transforms
if (this->NumberOfTransforms > 0)
{
......
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