Jump to content
  • Advertisement
Sign in to follow this  
i1977

Finding out which DirectX objects are still allocated

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

The game I'm working on has a problem running on Windows 98. It runs fine the first time around, but if I quit the game and restart it a second time (or third, or fourth...), the game crashes when calling this: Direct3DCreate9(D3D9b_SDK_VERSION); If I use the debug run-time, this is what I get from this call when running the game for the second time: Direct3D9: (ERROR) :ExtEscape rc=-1, GetLastError=87 Direct3D9: (ERROR) :****DirectDraw/Direct3D DRIVER DISABLING ERROR****:No DDCREATEDRIVEROBJECT support in driver My guess was that it was probably due to some Direct3D object(s) not being released properly, and since Win98 does a much poorer job at cleaning up the mess after a program exits than Win2000 or WinXP does, I figured it was still interfering with the creation of Direct3D when running the game for the second time. So sure enough, when quitting the game after the first run, the debug run-time reported the following: Direct3D9: (ERROR) :Memory still allocated! Alloc count = 73 Unfortunately, the debug run-time is not very helpful about the leak... :) It just says it's there, nothing more. So, my question is: is there a way to at least get an idea of what has not been released? For example, is it a texture, a shader, a vertex buffer? Object creation and destruction is not cleanly encapsulated in specific spots in our code, so it could be long chasing blindly after the leak. Any ideas? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
have you tried ramping up the directx error reports in the control panel to maximum? i still dont think it will list exactly what has not been released, but perhaps it can give your more info about it.

maybe give d3d spy a shot too, bind it with your app and watch it as it counts and then uncounts resources as they are created and released until the game exits.

if not, really the only other "best way" to do it is to comment all the directx modules out of your engine, and then slowly add them back in 1 by one until you can approximate which module is causing the error. then just home in on that particular one.

but yeah memory errors are nasty, no really easy way to nail them.

good luck though!

Share this post


Link to post
Share on other sites
D3D should spit out a list of alloc IDs, you can use the DirectX control panel to break on an alloc ID, so you can see whats what.

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!