Jump to content

View more

Image of the Day

Boxes as reward for our ranking mode. ヾ(☆▽☆)
#indiedev #gamedev #gameart #screenshotsaturday https://t.co/ALF1InmM7K
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Check for stray resources after program termination

4: Adsense

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.


  • You cannot reply to this topic
3 replies to this topic

#1 SikCiv   Members   

122
Like
Likes
Like

Posted 09 December 1999 - 07:49 PM

Say a program uses many bitmap handles and malloc'd data, and doesnt release them all, is there a program to check for handles/data still in memory, or does the program release all handles and malloc'd data automatically?

#2 Anonymous Poster_Anonymous Poster_*   Guests   

Likes

Posted 09 December 1999 - 06:33 PM

In VC6, there is a way to have it print out a listing of all memory that you didn't free, but it won't tell you which variable it is. It will tell you the address, size and contents for each block though.
Somewhere in your program (I usually put it right before the program exits), add the line:

_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF);

When you run the program (in debug mode), a report will be printed out in the debug window after the program finishes executing.
include file is

Note: I have no idea if this works in other compilers, or environments other than windows 95/98/nt.


#3 Anonymous Poster_Anonymous Poster_*   Guests   

Likes

Posted 09 December 1999 - 06:35 PM

html got the include, should be crtdbg.h

#4 mason   Members   

128
Like
Likes
Like

Posted 09 December 1999 - 07:49 PM

There are also commercial tools that do this sort of thing.

One of the best is called BoundsChecker... it's pricey, but for serious development, it's well worth the cash. Catches virtually all types of memory leaks, resource leaks, etc.

Mason McCuskey
Spin Studios
www.spin-studios.com





Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.