[EMAIL PROTECTED] writes:

> + Then, I'm getting pointer to a newly allocated buffer of char elements:
> + char* str = value.transcode();
> + 
> + Then, I'm going to delete that allocated area:
> + delete str; // DAMAGE before free block
> + 
> + What do I do wrong? I was looking into your code in DOMPrint.cpp
>   and found this
> + piece:
> + ostream& operator<< (ostream& target, const DOMString& s)
> + {
> +     char *p = s.transcode();
> +     target << p;
> +     delete [] p;
> +     return target;
> + }
> + Looks like the same! But something I'm overlooking... Because of
>   that my
> + program has memory leaks. Could you please explain me my mistake
>   ASAP. It's
> + critical for my project. Thank you.


delete str;

is not the same as:

delete [] str;

jas.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to