SlimDX.Direct3D9.Mesh does not clean up its owned VertexBuffer and IndexBuffer.
This feels wrong, because the Mesh created these (hence my description as
'owned') so it should also clean them up. Accessing a property on a Mesh
instance does not show me clearly that a new object is instantiated or that it
has become my responsibility for cleaning up.
Steps to reproduce:
- Start Direct3D
- Instantiate a SlimDX.Direct3D9.Mesh (for example, use Mesh.CreateBox())
- Access the VertexBuffer or IndexBuffer property. (for example set
d3ddevice.Indices = mesh.IndexBuffer)
- Dispose your Mesh (mesh.Dispose())
- Shutdown Direct3D
- Notice memory leaks in the debug log
Temporary workaround:
- Dispose the VertexBuffer and IndexBuffer manually
(mesh.VertexBuffer.Dispose(), mesh.IndexBuffer.Dispose() then mesh.Dispose())
Original issue reported on code.google.com by klapstoe...@gmail.com on 22 Jan 2011 at 8:27
Original issue reported on code.google.com by
klapstoe...@gmail.com
on 22 Jan 2011 at 8:27