Sign in to follow this  
ArchangelMorph

Cleaning up device objects..

Recommended Posts

I'm coming to the end of the grind with my current project but I encountered a little problem.. My app doesn't seem to clean up all my device objects in certain circumstances but in others it sorts everything out perfectly.. In my app I create the device-related objects for my menu system at startup and then create those which relate to my game when a new game has been selected and has begun to load.. once a game has finished I clean up all the game-related objects as I return to the main menu system and then clean up the main menu system objects on application termination.. Now when I load the app into the menus and then terminate the app its fine.. When I load up the app, load up a new game and then terminate the app its still not a problem.. However when I load up the app, a new game and then return from the game back to the main menu, on terminating the app I get a memory leak.. Please note that every app termination control calls exactly the same set of methods to clean up all the objects in the app.. I've tried running the debugger but it doesn't help me isolate exactly where the memory leak occured so I don't know which object is not being destroyed so I can sort out the code for it.. So I need to know how I could isolate the problem and then deal with it? Anyone else encountered any problems like this in the past? How did you overcome them?

Share this post


Link to post
Share on other sites
Have you tried to use PIX? PIX has a profile option called "replayable call stream". If you run your program in PIX with this option, it will give you a report of every object you created with DirectX. Once you have that, you can find which objects aren't being cleaned up and go from there.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this