Advertisement

free( ) failing?????? HELP!!!!

Started by June 04, 2001 11:35 AM
20 comments, last by KaneBlackflame 23 years, 8 months ago
I did that many times...it''s only one dll, but I redid the whole project several times. Anyone know a list of reasons free could fail...even if they have already been mentioned?
"Victims...aren't we all?" -Brandon Lee, the Crow
OK: if the list of pointers is exactly the same right after you
malloc and right before you free, then the only other thing I
can think of is that you have some other part of your program
(progress callback or DoEvents?) that is destroying memory.
You could have an uninitialized pointer or something overrunning
array bounds, which is then running into your allocated pointers
and destroying the records there--malloc stores data with each
pointer it returns in the memory just before the pointer
returned, and if this is corrupted then the free calls can be
undefined. (PS: this is the answer to the poster who asked,
"How does malloc know how much memory to free")

Kane, if you want to send me the data file you''re parsing, the
key string you''re using and the other switches to your function
(i.e. KeyNum, KeepThere), I have a stand-alone replica of the
code you''ve posted running here with calls to the callback and
DoEvents removed. If it works for me, then the problem is with
your external code in DoEvent, the callback, or another thread
if you''re doing this multithreaded. You can mail it to me at
jrsmith667@hotmail.com

This topic is closed to new replies.

Advertisement