[vtkusers] deleting vtkRenderWindowInteractor causes crash

Philippe Bruyant pbruyant at yahoo.com
Thu Nov 1 03:10:23 EDT 2007


Hello experts,
I'm using MS VC++ 6.0, VTK 5.0 and Windows Vista.
I've created a small dialog-based app. which create a
VTK scene in a CStatic control.
When I close the app, I delete the VTK "objects". But
when I delete the vtkRenderWindowInteractor object, I
get an error from my debugger:
HEAP[MyApp.exe]: Invalid Address specified to
RtlValidateHeap( 003A0000, 00364D98 )

If I don't delete the interactor, I get memory leaks!
What's going on?
Below, the code.
Thanks,
Phil
/********************************************************************************/
VTKScene::VTKScene(CStatic *pStatic)
{
  renderer=vtkRenderer::New();
  renWin=vtkRenderWindow::New();
  iren=vtkRenderWindowInteractor::New(); 
}

/********************************************************************************/
VTKScene::~VTKScene()
{
  if (renderer) renderer->Delete();
  if (renWin) renWin->Delete();
  if (iren) iren->Delete();  
}
/********************************************************************************/


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the vtkusers mailing list