In the following code is an excerpt from a String class that I've written.

--- begin code ---

char* _s;

String& String::operator=(const String& newString)
{
    if ( _s )
        delete []_s;
    _len = newString._len;
    _s = new char[_len + 1];
    StrCopy( _s, newString._s );
    return( *this );
}

--- end code ---

Occasionally (it doesn't happen every time, but it is reproducible) I
receive the following error when the line

    _s = new char[ _len + 1 ];

is executed:

"During a regular check up, Poser determined that the dynamic heap chuck
with the header address 0x00019974 got corrupted.  The size of the chunk
(%chunk_size) was larger than the currently accepted (%chunk_max)."

Any ideas as to what might cause this?

Thanks,

Kevin



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to