Ok, I will do it right now.<br><br>-Laurent<br><br><div class="gmail_quote">On Mon, Jul 18, 2011 at 2:27 PM, Bill Lorensen <span dir="ltr"><<a href="mailto:bill.lorensen@gmail.com">bill.lorensen@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">It would be great if you could provide a gerrit patch following these<br>
instructions:<br>
<a href="http://itk.org/Wiki/VTK/Git#Gerrit" target="_blank">http://itk.org/Wiki/VTK/Git#Gerrit</a><br>
<br>
and please let us know if the instructions are correct.<br>
<font color="#888888"><br>
Bill<br>
</font><div class="im"><br>
On Mon, Jul 18, 2011 at 2:20 PM, Laurent Chauvin<br>
<<a href="mailto:lchauvin@bwh.harvard.edu">lchauvin@bwh.harvard.edu</a>> wrote:<br>
</div><div><div></div><div class="h5">> Hello,<br>
><br>
> I was using vtkLoopSubdivisionFilter, but after leaving Slicer I got hundred<br>
> 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<br>
> 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<br>
> not deleting before returning ?<br>
><br>
> Thank you.<br>
> -Laurent<br>
><br>
> --<br>
> Laurent Chauvin, MS<br>
> Surgical Planning Laboratory, Radiology<br>
> Brigham And Women's Hospital, Harvard Medical School<br>
> <a href="http://wiki.ncigt.org/index.php/User:Lchauvin" target="_blank">http://wiki.ncigt.org/index.php/User:Lchauvin</a><br>
><br>
</div></div><div><div></div><div class="h5">> _______________________________________________<br>
> Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
><br>
> Visit other Kitware open-source projects at<br>
> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
><br>
><br>
><br>
</div></div></blockquote></div><br><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>