Problems with delete []

Hi you all,

I have a big structure data made by nested arrays and one of them is dynamic.

struct
int
array
int
array
int
dynamic_array
int
array
int
array
array



When I delete [] array_dinamic, the memory doesn't free. Is there a problem with this because it has arrays and structures inside it?

Thanks a lot.
What makes you think that delete[] doesn't free the memory? Can you show us your structure and array code?
When I delete [] array_dinamic, the memory doesn't free
Why not?

Is there a problem with this because it has arrays and structures inside it?
Nope, the problem arises when you copy the pointer and frees it twice (or more)
It's like this
struct1
=>int
=>array
==>int
==>array
===>int
===>dynamic_array
====>int
====>array
======>int
======>array
======>array

sorry, I can't show you my code
Thanks a lot.
Regards
Well I am not terribly psychic, but rest assured, if you implemented your code correctly then you should not run into any problems.
Topic archived. No new replies allowed.