problem with vtk openGL windows

hi everyone
I’m using matlab(release 13) with vtk java visualization tool kit to open Win32openGL windows and add some 3d shapes. everytime I try to close a windows like this, matlab crash and close the whole application.
can anyone look at the code below and tell me what’s wrong?
thanks in advance, here is the code:

import vtk.*
panel=vtkPanel;
ren1=vtkRenderer;
renWin=vtkRenderWindow;
renWin.AddRenderer(ren1);
iren=vtkRenderWindowInteractor;
iren.SetRenderWindow(renWin);
cam1=ren1.GetActiveCamera;
cam1.SetEyeAngle(5)

iren.Initialize;