Subj : Re: Multi-Thread and memory allocation error (or bug in 5.02). To : borland.public.cpp.borlandcpp From : Bob Gonder Date : Fri Aug 29 2003 01:07 pm Martin Catney wrote: > >I get an access violation at 0x634b5e: read of address 0x4cdc058 when I run >the example. This corresponds to the line >delete[] array; It might be instructive to know the value of j at that point. >Does anyone spot an obvious error in my example or is this a bug in the Just some thoughts... I would think you should create the arrays before you start the thread. And I would change this > for (int j=0; j < mLength ; j++){ > array = thearray[j]; > delete[] array; > } to this while( mLength-- ) //mLength no longer needed delete[] theArray[ mLength ]; // reverse order of new I would also make "array" a local variable instead of an object member. At least, the code you gave doesn't require a member named "array". Don't know if any of that will fix your problem, but I'd start there. .