Hello everybody,
I try to remove actors from the renderer, but my program always crashes.
the following error message appears:
vtkWin32OpenGLRenderWin:217 ERR| vtkWin32OpenGLRenderWindow (0000000027348C40): wglMakeCurrent failed in MakeCurrent(), error: The requested resource is already in use.
#
# A fatal error has been detected by the Java Runtime Environment:
#
# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x00007ffdf99de33d, pid=3760, tid=0x0000000000004278
#
# JRE version: Java™ SE Runtime Environment (8.0_181-b13) (build 1.8.0_181-b13)
# Java VM: Java HotSpot™ 64-Bit Server VM (25.181-b13 mixed mode windows-amd64 compressed oops) …
The crash happens within this code snippet:
public void Clear3DView() {
vtkActorCollection actors = this.ren.GetActors();
vtkPropCollection props = ren.GetViewProps();
vtkActor lastActor = actors.GetLastActor();
System.out.println(" Actors = "+actors.GetNumberOfItems());
System.out.println(" Props = "+props.GetNumberOfItems());
try {
ren.RemoveActor(lastActor); // Crash
} catch (Exception e) {
e.printStackTrace();
}
this.ren.ResetCamera();
this.ren.ResetCameraClippingRange();
this.ren.InteractiveOff();
this.validate();
this.repaint();
}
Seems to be a issue with java.
Does anyone have an idea what this is due to or how do I fix it?