[vtk-developers] TestImageDataToStructuredGrid test fails with leaks
Dean Inglis
dean.inglis at camris.ca
Thu Feb 24 21:06:33 EST 2011
Filtering/Testing/Cxx/TestImageDataToStructuredGrid.cxx
has two memory bugs:
1) vtkUniformGrid* GetGrid( double *origin, double *spacing, int *ndim )
returns a vtk object but there is no way to have it delete and
within this function there is
vtkDoubleArray* pntData = vtkDoubleArray::New();
another object is thus created but not deleted locally.
Perhaps changing the function signature to:
void GetGrid( vtkUniformGrid* grid, double *origin, double *spacing, int
*ndim )
and then instantiate and delete the grid in the main calling function.
Dean
More information about the vtk-developers
mailing list