Jump to content
  • Advertisement
Sign in to follow this  
Alexander Dronov

[SlimDX]Direct3D and VertexBuffer objects were not disposed ...

This topic is 3253 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

After my form closed, I get following error message in output window. Direct3D object was not disposed. Object of type SlimDX.Direct3D9.VertexBuffer was not disposed. ... same ... same Total of 1006 objects still alive. Can you give me an example, in what order should I dispose objects ?

Share this post


Link to post
Share on other sites
Advertisement
My question is, are you disposing of them at all?

You must explicitly call Dispose() on each one of your COMObjects.

Share this post


Link to post
Share on other sites
Quote:

My question is, are you disposing of them at all?


No, Before yesterday (day) I didn't dispose any objects. I accidentally found out that error only yesterday (day).

Quote:
You must explicitly call Dispose() on each one of your COMObjects.


Ok, I have a code:


Device _device;
Direct3D _direct3d;

...
_direct3d = new Direct3D();

_device = new Device(_direct3d, 0, DeviceType.Reference, IntPtr.Zero, CreateFlags.SoftwareVertexProcessing, present_params);


In which order should I dispose that objects:

_direct3d.Dispose();
_device.Dispose();

or

_device.Dispose();
_direct3d.Dispose();

Or it doesn't matter ?

Share this post


Link to post
Share on other sites
Quote:
Original post by Alexander Dronov
In which order should I dispose that objects:

_direct3d.Dispose();
_device.Dispose();

or

_device.Dispose();
_direct3d.Dispose();

Or it doesn't matter ?
It doesn't matter, although best practice is to dispose them in the reverse order they were created in (So the device, then the D3D interface).

It's more likely that you're not disposing an interface somewhere. Has this problem only recently shown up? If so, it'll be a problem in the code you've recently added.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!