Subj : Re: Multi-Thread and memory allocation error (or bug in 5.02). To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Tue Sep 02 2003 10:20 am Martin Catney wrote: >Maybe I was not clear enough. With the actual data class I will be able to >delete the array in the reverse order but there will be a lot of other >allocations occurring with in the application which will be longer lived. >This causes the memory to be fragmented and at some point the deallocation, >or thread termination, is corrupting the memory or stack. Ok, yeah. I always try to make sure in those cases that I allocate the longer lived stuff sooner rather than later so that they _can_ be destroyed in the proper order. ( or _not_ destroyed at all, but simply reused....buffers or arrays mostly) That is, you don't alloc the short-term stuff, then the long then destroy the short. .