Spotlight: Leak Locator #

Today I finished the transferring of depths, it simply required determining the source pixmaps and target pixmaps for all three sizes, and doing a CopyBits between them.

Then I fooled around with a pretty interesting product called Spotlight. It's supposed to aid you in finding memory leaks, access of unlocked handles, access of null pointers/handles, and other hard to track down but serious bugs. They have a demo version, which has all the features except it expires in a month. Using it requires no change of code, you simply point to the symbol map of your program (an .xSYM file that's generated by default by CodeWarrior) and then you run your program (albeit more slowly, since it has to log all the errors).

With this tool I found a bunch of handles I wasn't disposing, and places where I was accessing NULL handles. I also found a very weird bug with it. When saving the state for the first time the program is run, it uses up an extra 64K of memory, which are never disposed of. Using FreeMem() I added a check right before I called new and right after, and it said that it took up 70K. However if I added a check within the constructor of the drawingStateClass, it always said 6K. But I have no idea where the extra 64K are coming from, and why they only show up the first time...

Post a Comment