void VisuGUI_CutPlanesPane::deletePlanes()
{
if (myPreviewActor == 0) return;
- if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
- vf->RemoveActor(myPreviewActor);
+ vtkRenderer* aRend = myPreviewActor->GetRenderer();
+ if(aRend)
+ myPreviewActor->RemoveFromRender(aRend);
+// Bug IPAL11962: preview is still in the viewer, if viewer not active.
+// if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>())
+// vf->RemoveActor(myPreviewActor);
myPreviewActor->Delete();
myPreviewActor = 0;
}