I recently updated VTK from 5.6 to the 5.9 version from Git. Now when I close my application, I get this error repeated quite a few times: &quot;a vtkShader2 object is being deleted before ReleaseGraphicsResources() has been called.&quot;<div>

<br></div><div>After a while I found the origin of the this problem. I have a vtkVolume, and throughout the program the mapper of this vtkVolume is gets changed. So, every now and then I do a call vtkVolume-&gt;setMapper(someMapper);</div>

<div>This used to work fine, and the (visual) results do still work. However, when I comment out the setMapper() lines, the errors do not occur when exiting. I was able to get rid of the errors by prepending the setMapper() call with a ReleaseGraphicsResources() call. So my code now looks something like this:</div>

<div><br></div><div><div>volume-&gt;ReleaseGraphicsResources(renWin);</div><div>volume-&gt;SetMapper(volumeMapper);</div></div><div><br></div><div>Is this intended and expected behavior, or is it a bug?</div><div><br></div>

<div>Cheers,</div><div>Tijmen</div>