Page 1 of 1

how to properly destroy an array of images

Posted: Sat Oct 24, 2009 11:06 pm
by elim
We know

Code: Select all

ImageDestroy($anImg);
Is the way of destroy an image created by php code. But if I have an array of such images,
what's the proper way of destroy the array (give all the corresponding memories back to the system)?
Thanks for your anwser.

Can I just do
unset($imgArray);
???

Re: how to properly destroy an array of images

Posted: Sun Oct 25, 2009 4:39 am
by requinix
unset should work, but in case it doesn't (quite possible),

Code: Select all

array_map("imagedestroy", $imgArray);

Re: how to properly destroy an array of images

Posted: Mon Oct 26, 2009 2:04 pm
by pickle
Ya, you should be able to just unset() the array.