ANTONI SILVESTRE PADROS
antoni at tid.es
Wed Feb 25 13:15:41 CET 2009
Hi, I have a question about the function pgm_image_clear, I have an image I use as a container that dynamically loads images from files. In order to do that first I use pgm_image_clear to free the previous image and then I use pgm_image_set_from_file to load the new one.
The problem is that I've been profiling a little bit the program and it looks like pgm_image_clear doesn't really free the memory associated with the old image as after a few image changes more memory is used. I haven't seen any other way of changing the content of an image without actually destroying the image object and creating it again from scratch (and thus having to update any references pointing to it), so I'd like to make sure that pgm_image_clear really frees the memory associated with the previous image content.
More information about the pigment