Hello,<br><br>I was using vtkLoopSubdivisionFilter, but after leaving Slicer I got hundred of thousands of vtkIdList leaks.<br><br>After debugging, the problem seems to come from this part of code:<br><br>void vtkLoopSubdivisionFilter::GenerateEvenStencil (vtkIdType p1,<br>
vtkPolyData *polys,<br> vtkIdList *stencilIds,<br> double *weights)<br>
{<br> vtkIdList *cellIds = vtkIdList::New();<br> vtkIdList *ptIds = vtkIdList::New();<br> vtkCell *cell;<br><br> int i, j;<br> int numCellsInLoop;<br> int startCell, nextCell;<br> vtkIdType p, p2;<br> vtkIdType bp1, bp2;<br>
int K;<br> double beta, cosSQ;<br><br> // Get the cells that use this point<br> polys->GetPointCells (p1, cellIds);<br> numCellsInLoop = cellIds->GetNumberOfIds();<br> if (numCellsInLoop < 1)<br> {<br>
vtkWarningMacro("numCellsInLoop < 1: " << numCellsInLoop);<br> stencilIds->Reset();<br><br> // Test Remove vtkIdList<br> cellIds->Delete();<br> ptIds->Delete();<br> // End Test<br>
<br> return;<br> }<br> // Find an edge to start with that contains p1<br><br>...<br>cellIds->Delete();<br>ptsIds->Delete();<br>}<br><br>If we return before the end of the function, the cellIds and ptsId are not deleted (creating leaks).<br>
I had the code between comments "Test Remove vtkIdList" and "End Test".<br><br>Leaks are gone.<br><br>I just would like to know if it was a mistake or if there is a reason for not deleting before returning ?<br>
<br>Thank you.<br>-Laurent<br clear="all"><br>-- <br><div>Laurent Chauvin, MS</div><div>Surgical Planning Laboratory, Radiology</div><div>Brigham And Women's Hospital, Harvard Medical School<br></div><div><a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a></div>
<br>