Once you've finished using the image library, you should clean up by
unlocking the hardware, and freeing the part of the image structure
that you're responsible for. For example:
- First, free the buffer that is being pointed to from the
pixel member of your img_t structure.
- Deallocate the img_t structure that holds the information for
the image.
- Use img_lib_detach() to detach from the image library and free
all associated resources.
- Close the input stream by using the function io_close().
- If you've used screen buffers to display the image, free the
buffers and any associated memory used by the Screen and
Windowing Library functions.