Commit ba897761 authored by Bill Lorensen's avatar Bill Lorensen
Browse files

ERR: memory leak if abnormal return from Execute.

parent 8f279b6f
......@@ -122,7 +122,10 @@ void vtkTubeFilter::Execute()
if ( !lineNormalGenerator.GenerateSlidingNormals(inPts,inLines,(vtkFloatNormals*)inNormals) )
{
vtkErrorMacro(<< "No normals for line!\n");
inNormals->Delete();
if (deleteNormals) inNormals->Delete();
newPts->Delete();
newNormals->Delete();
newStrips->Delete();
return;
}
}
......@@ -198,6 +201,10 @@ void vtkTubeFilter::Execute()
if ( vtkMath::Normalize(sNext) == 0.0 )
{
vtkErrorMacro(<<"Coincident points!");
inNormals->Delete();
newPts->Delete();
newNormals->Delete();
newStrips->Delete();
return;
}
......@@ -224,6 +231,10 @@ void vtkTubeFilter::Execute()
if ( vtkMath::Normalize(w) == 0.0)
{
vtkErrorMacro(<<"Bad normal s = " << s[0] << " " << s[1] << " " << s[2] << " n = " << n[0] << " " << n[1] << " " << n[2]);
if (deleteNormals) inNormals->Delete();
newPts->Delete();
newNormals->Delete();
newStrips->Delete();
return;
}
......
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