OpenGL2: context clashes
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
When an actor is removed from a renderer, the renderer calls the actor's ReleaseGraphicsResources which ends up deleting array objects whose opengl handles are context-specific. Therefore, the window should be made current beforehand, otherwise another window's objects will be affected.
AFAIK, the documentation does not require calling MakeCurrent before removing an actor. I think it should either be made explicit, or RemoveViewProp should call MakeCurrent itself. Ideally, the previous current context should be restored upon exiting RemoveViewProp (*).
Another instance of the same problem: calling vtkWin32OpenGLRenderWindow::Finalize will destroy the context. If the ReleaseGraphicsResources haven't been called first, they will when called affect an unintended context.
(*) BTW: MakeCurrent is called from some places deep in the code (eg vtkWindowToImageFilter, vtkTextureObject::ReleaseGraphicsResources). I believe they should restore the previous context, or all hell could break loose in corner cases, like a vtkWindowToImageFilter used as input to a mapper in a different context.