Krzysztof Klimczak
2004-01-04 11:51:03 UTC
Hi all,
I have a simple code like this:
CString lpszSection;
CString lpszEntry;
UINT Bytes;
BYTE *pData = NULL;
if (!GetProfileBinary((LPCTSTR)lpszSection, lpszEntry,
&pData, &Bytes)) {
..
}
...
if ( pData )
delete [] pData;
The last line (delete []) in Debug build causes the
error:
DAMAGE: after normal block (#xxx) at 0x0....
After debug I found that the error is generated in
dbgheap.c module at line 1150.
After choosing continue another dialog appears saying:
Unhandled exception at 0x1... (msvcr71d.dll) in x.exe:
User breakpoint.
And then the program continues normally till next time
the code is executed.
The pData contains always 14 bytes of data, here is the
sample:
Data: <20040104004950> 32 30 30 34 30 31 30 34 30 30 34
39 35 30
For me it seems like bug in the heap handling in Debug
mode. The same happened when I used the VC++ 6.
Does anybody have an idea how to fix it?
The error does not appear in the Release build.
Regards,
Krzysztof
I have a simple code like this:
CString lpszSection;
CString lpszEntry;
UINT Bytes;
BYTE *pData = NULL;
if (!GetProfileBinary((LPCTSTR)lpszSection, lpszEntry,
&pData, &Bytes)) {
..
}
...
if ( pData )
delete [] pData;
The last line (delete []) in Debug build causes the
error:
DAMAGE: after normal block (#xxx) at 0x0....
After debug I found that the error is generated in
dbgheap.c module at line 1150.
After choosing continue another dialog appears saying:
Unhandled exception at 0x1... (msvcr71d.dll) in x.exe:
User breakpoint.
And then the program continues normally till next time
the code is executed.
The pData contains always 14 bytes of data, here is the
sample:
Data: <20040104004950> 32 30 30 34 30 31 30 34 30 30 34
39 35 30
For me it seems like bug in the heap handling in Debug
mode. The same happened when I used the VC++ 6.
Does anybody have an idea how to fix it?
The error does not appear in the Release build.
Regards,
Krzysztof