Pyabo
09-29-2004, 04:40 PM
I've got an app that is consistently leaking memory... the odd thing is that the code appears to be correct. The code is clearly calling "delete []" in the proper context... but the memory is NOT being freed. What can cause this? Some very specific heap correuption is the only thing I can think of, but the code looks correct and I'm not seeing any other telltale signs of memory corruption. I've also double-checked that delete is not being overloaded.
Further details:
Basically, it's a loop where something is being downloaded... looks like this:
download some stuff into OLDBUFF
if (we still got some more to download) then
1. allocate a new bigger buffer NEWBUFF
2. copy OLDBUFF into NEWBUFF
3. delete OLDBUFF (should release mem at this point!?!)
4. OLDBUFF pointer = NEWBUFF
Repeat ad nauseum... The problem appears that the delete call is not actually freeing the memory. :confused:
Am I missing something totally obvious here?
Further details:
Basically, it's a loop where something is being downloaded... looks like this:
download some stuff into OLDBUFF
if (we still got some more to download) then
1. allocate a new bigger buffer NEWBUFF
2. copy OLDBUFF into NEWBUFF
3. delete OLDBUFF (should release mem at this point!?!)
4. OLDBUFF pointer = NEWBUFF
Repeat ad nauseum... The problem appears that the delete call is not actually freeing the memory. :confused:
Am I missing something totally obvious here?