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-&gt;GetPointCells (p1, cellIds);<br>  numCellsInLoop = cellIds-&gt;GetNumberOfIds();<br>  if (numCellsInLoop &lt; 1)<br>      {<br>
      vtkWarningMacro(&quot;numCellsInLoop &lt; 1: &quot; &lt;&lt; numCellsInLoop);<br>      stencilIds-&gt;Reset();<br><br>      // Test Remove vtkIdList<br>      cellIds-&gt;Delete();<br>      ptIds-&gt;Delete();<br>      // End Test<br>
<br>      return;<br>      }<br>  // Find an edge to start with that contains p1<br><br>...<br>cellIds-&gt;Delete();<br>ptsIds-&gt;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 &quot;Test Remove vtkIdList&quot; and &quot;End Test&quot;.<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&#39;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>