System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source="vtkCommonDotNet"
StackTrace:
at vtk.vtkObjectBase.!vtkObjectBase()
at vtk.vtkObjectBase.Dispose(Boolean )
at vtk.vtkObject.Dispose(Boolean )
at vtk.vtkViewport.Dispose(Boolean )
at vtk.vtkRenderer.Dispose(Boolean )
at vtk.vtkObjectBase.Finalize()
I can't find where to handle it. I get it at last scope of "Main".
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi All
I get an exception when I close application:
System.AccessViolationException was unhandled
Message="Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source="vtkCommonDotNet"
StackTrace:
at vtk.vtkObjectBase.!vtkObjectBase()
at vtk.vtkObjectBase.Dispose(Boolean )
at vtk.vtkObject.Dispose(Boolean )
at vtk.vtkViewport.Dispose(Boolean )
at vtk.vtkRenderer.Dispose(Boolean )
at vtk.vtkObjectBase.Finalize()
I can't find where to handle it. I get it at last scope of "Main".
This is often caused by (mouse) interactors which are not disabled, before closing or switching rendering method.
The Garbage collector will clean up objects (like windows), which the mouse observer still try to access...
Thus use "iren.Disable()" before disposing any objects.
It does not help.... (
I found that I got such error only if I switch between renderers during application worktime:
vtkFormsWindowControl.GetRenderWindow().RemoveRenderer(renderer3D);
vtkFormsWindowControl.GetRenderWindow().AddRenderer(renderer2D);
I can switch between renderers many times, but exception will be raised only when I close application.