crtdbg.h memory leak

Sep 1, 2011 at 3:25pm
hello, I work on a library, every thing allocated in the library is reported as memory leak even though there isn't a memory leak at all
library is dynamically linked to the executable

this is how I detect memory leaks

#define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)
#include <crtdbg.h>
#define new DEBUG_CLIENTBLOCK

_CrtDumpMemoryLeaks();

these are example memory leak reports

{7165} normal block at 0x00DE7840, 24 bytes long.
Data: < s > E0 12 D5 00 88 73 DE 00 E0 12 D5 00 15 00 00 00
{7164} normal block at 0x00DE77E8, 24 bytes long.
Data: <xt w xt > 78 74 DE 00 90 77 DE 00 78 74 DE 00 06 10 CD CD

when I intentionally did a memory leak it reported as

d:\amz\amazing3d\amzmain\include\amzCPtr.h(22) : {9241} client block at 0x00D4F6D0, subtype 0, 4 bytes long.
Data: < > 01 00 00 00

Sep 1, 2011 at 4:30pm
Well, I personally don't see the value in this at all ...
Sep 1, 2011 at 5:02pm
I personally don't see the value in this

what do you mean ?

I believe that, the memory allocated by library comes from another heap than the executable, or something like this happens so I get wrong reports. I probably miss use debug functions or I have a dynamic linking problem but I cant manage to figure it out yet

for example, in the executable project I create a Line object which is defined in the library. compiler gives memory leak reports even though neither Line object is created as a pointer nor line object it self allocate memory by new

1
2
3
4
5
#include "mylib" // .libs are included without any linking problems or warnings

void main() {
 Line l; // this line cause memory leak
}
Sep 1, 2011 at 5:04pm
Oh, you're trying to ask a question?
Sep 1, 2011 at 5:08pm
yes, I want to ask if some one has an idea about why I get this kind of false reports
Topic archived. No new replies allowed.