Misreported Resource leak

0 Likes

Problem:

when a class which allocates a windows resource in the constructor and releases it in its destructor has a global instance, I get a false resource leak detected by BC.

Resolution:

Unfortunately there is nothing we can do about this. As the readme details, once the OS decides to unload our dll, there's nothing that BoundsChecker can do but comply, nor can we control the order in which a dll is loaded/unloaded. Global variables are usually handled by the crt in the a special DllMAin. We log the allocation, but are then forced to unload before the deallocation takes place. The decision was made to report the leak, to be on the safe side.

Old KB# 11894
Comment List
Anonymous
Related Discussions
Recommended