Archived

This topic is now archived and is closed to further replies.

Jok

Hanging Up

Recommended Posts

When starting D3DApp, it suddenly hangs up. But it may run 3 or 2 times before it will hang up. It also hangs up at the shutting down as well. I do clean up carefully. What should i do?

Share this post


Link to post
Share on other sites
Make sure you delete any resources in the opposite order you created them. Check the bounds that you don''t try to write more than you have allocated. Check pointers that you don''t use pointers that you have released. Always put NULL in a pointer that you don''t use. Here is an example for the render:

//in the application program loop
if(myDxdevice)
{
//do my dx stuff
}

Why is this important? Because when quitting the application the program is not stopping at once. It will still run one or more times before quitting, if you then have released the myDx9device you can see what will happen. Crash galore!

Most of the time when an application hangs it is because the program is either using an invalid pointer or going beyond allocated memory. Remember that using a directx function that needs something from memory might crash because the pointer to some memory is invalid for one reason or another.


____________________________________________________________
Try RealityRift at www.planetrift.com
Feel free to comment, object, laugh at or agree to this. I won''t engage in flaming because of what I have said.
I could be wrong or right but the ideas are mine.

Share this post


Link to post
Share on other sites
Use the Debug DX libraries, and in the control panel settings make sure the debug level is at maximum. Then, when your app closes down take a look in the output window to see if DX is reporting any memory leaks.

Share this post


Link to post
Share on other sites