Jump to content
  • Advertisement
Sign in to follow this  
quaker

Clean It and get error!

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

It's mentioned in the DX SDK that the clean up code should be handled upon receiving the WM_DESTROY message. However this seems to cause a problem upon exit (application error: breakpoint reached) even if I put the cleanup code at the end of the WinMain function. Where shoudl I add the cleanup code?

Share this post


Link to post
Share on other sites
Advertisement
The DXUT framework is always a good place to start - it's pretty much the textbook perfect reference implementation of how you should handle Direct3D [smile]

I've always handled my termination stuff at the end of WinMain and not had any problems. I wait for the quit message, bail out of the main loop on the next iteration and clean-up.

If you can provide us with more details then we might be able to spot something wrong with your implementation. Possibly you're destroying stuff and then accidentally re-using it (e.g. null pointers and other fun). Tell us which line its breaking on (use the VStudio callstack to identify which part of your code it stems from) and post any other relevant information and code fragments...

hth
Jack

Share this post


Link to post
Share on other sites
It seems to be a meory leak, resources still allocated, problem. I get this error from debug: when exist

Direct3D9: (WARN) :Memory still allocated! Alloc count = 249

The resources (textures/VBs/IBs) are all managed, and I don't think I need to release and re-create them when resetting the device.

Thanks.



Share this post


Link to post
Share on other sites
Quote:
Original post by quaker
The resources (textures/VBs/IBs) are all managed, and I don't think I need to release and re-create them when resetting the device.
No, you don't - but you do need to make sure that they're all SAFE_RELEASE()'d when the application finally closes down.

Debugging Direct3D memory leaks is an art in itself, my current preferred method is to run a full call-stream capture in PIX. Advance to the very last entry and check which resources are still flagged as "alive" - these are more than likely to be the ones that are causing you problems [smile]

hth
Jack

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!