andyhartman / slimdx

Automatically exported from code.google.com/p/slimdx
0 stars 0 forks source link

Sample throws ObjectDisposedException when disposing shared D3D9 texture #897

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
For example when running SlimDX/samples/Direct3D10/WpfSample10 (after enabling 
SlimDX.Configuration.DetectDoubleDispose = true;) I immediately get an 
ObjectDisposedException in the D3DImageSLimDX.Dipose() call to 
SharedTexture.Dipose().

Is the sample wrong to do this?

Original issue reported on code.google.com by petsu...@gmail.com on 6 Aug 2013 at 11:58

GoogleCodeExporter commented 8 years ago
In
https://code.google.com/p/slimdx/source/browse/trunk/samples/Direct3D10/WpfSampl
e10/D3DImageSlimDX.cs
changing
using (Surface Surface = SharedTexture.GetSurfaceLevel(0))
to
Surface Surface = SharedTexture.GetSurfaceLevel(0)
(i.e. not Disposing the ancillary(?) surface object) seems to fix this.

Original comment by petsu...@gmail.com on 6 Aug 2013 at 1:28