[wxVTK] memory leak when using wxWidgets and VTK
Brought to you by:
malat
From: Bangyou Z. <zhe...@gm...> - 2009-04-13 14:07:54
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=GB2312"> </head> <body bgcolor="#ffffff" text="#000000"> <font face="Arial">I have the similar problem about memory leak described by Premraj, Senthil Kumar. The URL is :<br> <br> <a class="moz-txt-link-freetext" href="http://sourceforge.net/mailarchive/forum.php?thread_name=CE95C4CC27808146AB22964FE8C94D66016D91462CAB%40IOWAEVS05.iowa.uiowa.edu&forum_name=wxvtk-users">http://sourceforge.net/mailarchive/forum.php?thread_name=CE95C4CC27808146AB22964FE8C94D66016D91462CAB%40IOWAEVS05.iowa.uiowa.edu&forum_name=wxvtk-users</a><br> <br> </font> <p><font face="Arial"><b>1) Problem description:</b></font></p> <font face="Arial">I need to redraw the vtkRenderer when users click the someplace of window. Firstly, the all props were deleted:<b><br> m_Renderer->RemoveAllViewProps();</b><br> <br> Then, these codes were used to redraw the vtkRenderer<br> <br> <b>vtkPoints * pts = vtkPoints::New();<br> vtkUnstructuredGrid * aTriangleGrid = vtkUnstructuredGrid::New();<br> vtkDataSetMapper * aTriangleMapper = vtkDataSetMapper::New();<br> vtkActor * Actor = vtkActor::New();</b><br> <br> // some codes to create the Props<br> <br> <b>m_Renderer->AddViewProp( Actor );<br> <br> pts->Delete();<br> aTriangleGrid->Delete();<br> aTriangleMapper->Delete();<br> Actor->Delete();</b><br> <br> Finally, The memory usage was growing with redrawing the vtkRenderer <br> <br> </font> <p><b><font face="Arial">2) My environment</font></b></p> <font face="Arial">Windows XP SP2</font><br> <font face="Arial">mingw32-gcc-3.4.5<br> </font><font face="Arial">wxWidgets 2.8.9 linked as dll<br> VTK 5.0 linked as dll<br> wxVTKRenderWindowInteractor cvs version (up to now)<br> <br> <br> I know this problem can be avoided by using linker's /delayload flag of MFC, but how to fix this problem for mingw? <br> <br> Thanks a lot!<br> <br> <br> <br> <br> </font> </body> </html> |