Original Post
Sometimes when I exit my managed DirectX application, it will hang inside the main form''s Dispose function (when I break the application, it references the closing bracket). I can only assume that this means it''s having trouble disposing of my DirectX resources. Right now, I have a Direct3D device, a single vertex buffer, and a collection of objects that manage their own index buffer. Each object has a reference to the Direct3D device so it can call DrawIndexedPrimitives.
When I add call to Device.Dispose() to the form''s dispose function, when I break the application after it hangs, the breakpoint is on the statement immediately following the Dispose call. This is why I assume there is a problem disposing of the graphics device. I''ve verified that it only hangs when the vertex buffer is created and each object holds a reference to the device.
I''m just looking for some suggestions on how to safely dispose of all my resources, and make sure my application doesn''t try to access them after they''ve been disposed of. Also, any ideas as to why it would hang on disposal would be greatly appreciated