Jump to content
  • Advertisement
Sign in to follow this  
Ehzyo

Memory Leak : Release() return 0 but DestroyObject not called

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

1. Two IDirect3DVertexDeclaration9 objects allocated by the function FindNextValidTechnique() are released but not destroyed. In PIX, the status "App Refs" is "0", but the status "Destruction" is "Never".
2. An IDirect3DIndexBuffer9 object allocated by the application is released but not destroyed. In PIX, the status "App Refs" is "0", but the status "Destruction" is "Never". After I call the function SetIndices(NULL), the memory leak of the index buffer disappears.
3. An IDirect3DVertexShader9 and an IDirect3DPixelShader9 object allocated by the function D3DXCreateEffect() are released but not destroyed. In PIX, the status "App Refs" is "0", but the status "Destruction" is "Never". However, After I call SetVertexShader(NULL) and SetPixelShader(NULL), the memory leak of the two disappear.
4. An IDirect3DSwapChain9 object allocated with the function CreateAdditionalSwapChain() is released but not destroyed. GetBackBuffer() is ever called, but the Surface is released later. In PIX, the status "App Refs" of them is "0", but the status "Destruction" of them is "Never".
5. Of cause, the IDirect3DDevice9 and IDirect3D9 object are released but not destroyed.

I'v checked the reference counts of all the objects in PIX and application. They are both 0. I don't know why the memory leak still occurs. And I don't think SetIndices(NULL) etc. are necessary. Could someone give me some advice? Thank you.

Share this post


Link to post
Share on other sites
Advertisement
If you have any resources selected (bound) in the device they are locked and will not be freed. Exactly what you thought about, SetIndices, SetVertexShader etc. is necessary, if the object you want to release is still referenced in there.
Imagine what happened if the resource was actually released.

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!