Re: [wxVTK] memory leak when using wxWidgets and VTK
Brought to you by:
malat
From: Mathieu M. <mat...@gm...> - 2009-04-14 12:32:54
|
[you do not need to duplicate email, you will not get duplicate answer] 2009/4/14 Bangyou Zheng <zhe...@gm...>: > I have the similar problem about memory leak described by Premraj, Senthil > Kumar. The URL is : > > http://sourceforge.net/mailarchive/forum.php?thread_name=CE95C4CC27808146AB22964FE8C94D66016D91462CAB%40IOWAEVS05.iowa.uiowa.edu&forum_name=wxvtk-users > > 1) Problem description: > I need to redraw the vtkRenderer when users click the someplace of window. > Firstly, the all props were deleted: > m_Renderer->RemoveAllViewProps(); > > Then, these codes were used to redraw the vtkRenderer > > vtkPoints * pts = vtkPoints::New(); > vtkUnstructuredGrid * aTriangleGrid = vtkUnstructuredGrid::New(); > vtkDataSetMapper * aTriangleMapper = vtkDataSetMapper::New(); > vtkActor * Actor = vtkActor::New(); > > // some codes to create the Props > > m_Renderer->AddViewProp( Actor ); > > pts->Delete(); > aTriangleGrid->Delete(); > aTriangleMapper->Delete(); > Actor->Delete(); > > Finally, The memory usage was growing with redrawing the vtkRenderer > > 2) My environment > Windows XP SP2 > mingw32-gcc-3.4.5 > wxWidgets 2.8.9 linked as dll > VTK 5.0 linked as dll > wxVTKRenderWindowInteractor cvs version (up to now) > > > I know this problem can be avoided by using linker's /delayload flag of MFC, > but how to fix this problem for mingw? > > Thanks a lot! I would think setting some renderer instance to NULL might help. (->SetRenderer(NULL)). HTH -- Mathieu |