The internal process of upgrading a paletted image to a direct image,
done when a color not in the palette is written to the image, no
long leaks a reference count to the context object.
i_img_rgb_convert(&temp, im);
/* nasty hack */
- (im->i_f_destroy)(im);
- myfree(im->idata);
+ i_img_exorcise(im);
*im = temp;
+ /* i_img_empty_ch() calls i_img_init() which takes a ref */
+ im_context_refdec(aIMCTX, "img_destroy");
+
return 1;
}