Its a bit of a dumb one, I know. But I cant see whats going wrong here...

I create a 2D array of pointers like so...
Code:
ENTITY*	*slab_ents[4];

void main()
{
   for(LOD=0; LOD<4; LOD++)
   {   slab_ents[LOD] = (ENTITY*)sys_malloc(a_set_size);   }
   ...

And it works fine.

BUT when I try to clear it with
Code:
...
   for(LOD=0; LOD<4; LOD++)   {   sys_free(slab_ents[LOD]);   }

I get "Malfunction W1516 : Invalid memory area" errors.

Any ideas? Its obviously a pointer issue, but I just want
some second opinions...

Last edited by EvilSOB; 12/04/11 17:00. Reason: RESOLVED

"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial