<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2600.0" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2><STRONG>Hello All,</STRONG></FONT></DIV>
<DIV><FONT face=Arial size=2><STRONG> I am using vtk for displaying a
bended tube in MFC window.</STRONG></FONT></DIV>
<DIV><FONT face=Arial size=2><STRONG>I am using VtkTubeFilter. It works well but
it contains a large amount of memory leaks.</STRONG></FONT></DIV>
<DIV><FONT face=Arial size=2><STRONG>My observation is that the most of
the leak is happening when i call <FONT
color=#008080>vtktubefilter->update().</FONT></STRONG></FONT></DIV>
<DIV><FONT face=Arial color=#000000 size=2><STRONG>am doing all this things in a
loop so memory leak is very bad problem. I hope someone can help
me</STRONG></FONT></DIV>
<DIV><FONT face=Arial size=2><STRONG> regards</STRONG></FONT></DIV>
<DIV><FONT face=Arial size=2><STRONG>Kannan</STRONG></FONT></DIV>
<DIV><FONT face=Arial size=2> part of my code...</FONT></DIV>
<DIV><FONT face=Arial color=#800080 size=2>vtkpoints m_pts;</FONT></DIV>
<DIV><FONT face=Arial color=#800080 size=2>vtkcellarray m_lines</FONT></DIV>
<DIV><FONT face=Arial color=#800080 size=2>vtkPolydata m_curve,
m_pvtkPolydata</FONT></DIV>
<DIV><FONT face=Arial color=#800080 size=2>vtkTubeFilter
m_pvtkTubeFilter</FONT></DIV>
<DIV><FONT face=Arial color=#800080 size=2>vtkPoints points</FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>m_pts->Initialize();</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>m_lines->Initialize();</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>m_curve->Initialize();</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=2>for(int
nCount=0;nCount<nCountOfPoints;nCount++)</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=2>{</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>m_pts->InsertNextPoint(tempPipePts.fXvalue,tempPipePts.fYvalue,tempPipePts.fZvalue);</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=2>}</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>m_lines->InsertNextCell(m_pts->GetNumberOfPoints());</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>for(nCount=0;nCount<m_pts->GetNumberOfPoints();nCount++)</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=2>{</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>m_lines->InsertCellPoint(nCount);</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=2>}</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>m_curve->SetPoints(m_pts);</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>m_curve->SetLines(m_lines);</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>m_pVtkTubeFilter->SetInput(m_curve);</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>m_pVtkTubeFilter->SetNumberOfSides(NO_OF_SIDES); </FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>m_pVtkTubeFilter->SetRadius(m_fPipeRadius);</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=2><FONT
color=#ff0000><STRONG>m_pVtkTubeFilter->Update();</STRONG></FONT></FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT
size=2>m_pVtkPolyData=g_pCNCHandler->m_pSimHandler->m_pVtkTubeFilter->GetOutput();</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2><FONT size=2><FONT
color=#800080>points</FONT>=g_pCNCHandler->m_pSimHandler->m_pVtkPolyData->GetPoints();
</FONT></FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV></BODY></HTML>