Jump to content
  • Advertisement
Sign in to follow this  
mdx

[SlimDX] Disposing Objects

This topic is 3451 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

I've got as simple question. Must i dispose all objects that created with slimdx ? Or does SlimDx do that for me. Example: creating a Fontmesh object:
Private _fontMesh As Mesh 
 _fontMesh = Mesh.CreateText(dxDevice, New System.Drawing.Font("Verdana", 26, FontStyle.Bold, GraphicsUnit.Pixel), "SlimDX", 1, 0.3)

If I won't dispose _fontMesh the directwindow of the IDE tells me: Object of type SlimDX.Direct3D9.Font was not disposed. Stack trace of object creation: Object of type SlimDX.Direct3D9.Mesh was not disposed. Stack trace of object creation: Total of 2 objects still alive. If I dispose _fontMesh, font is still alive ? The Debug - Directwindow tells: Object of type SlimDX.Direct3D9.Font was not disposed. Stack trace of object creation: Total of 1 objects still alive. thx for information

Share this post


Link to post
Share on other sites
Advertisement
Anything you create, you should Dispose() of. SlimDX objects do not have finalizers because they cause D3D to emit warnings about multithreaded access to the underlying objects.

Share this post


Link to post
Share on other sites
Thanks for the link.
So i do it that way.
But still some problems with dosposing the mesh

If i dispose the _fontmesh the mesh object is disposing fine, but the Font is still alive. (SlimDX.Direct3D9.Font)
But how can i dispose the font ?
I just create the _fontMesh object and the mesh creates the font.

thx for help



Share this post


Link to post
Share on other sites
I do not think that is where the Font is being created. Set Configuration.EnableObjectTracking to true, that will enable call stacks and you can see where it actually originates.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!