> On Mar 22, 2017, at 8:37 AM, Thimeau <thimeau.ad...@free.fr> wrote:
> 
> When calling HIImageViewSetImage() the image is retained by the view. So How 
> to make sure the retain image is being released before another image is set 
> by another call to HIImageViewSetImage().
> 
> Example:
> HIImageViewSetImage(myView, myImage1);        // First image retained by the 
> view
> CGImageRelease(myImage1);
> // Now I need to replace the first image of the image view by another image
> HIImageViewSetImage(myView, myImage2);        // Second image retained by the 
> view
> CGImageRelease(myImage2);
> 
> When doing this it appears that when setting the second image, 
> HIImageViewSetImage() doesn't release the first image creating a leak! Is 
> there a way to do this properly?

I looked at the code and it looks to me that the HIImageViewSetImage _should_ 
release the image already associated with the image view. I haven’t written a 
test app to confirm this, however.

If you can reproduce a problem with the image not being released, please file a 
bug with a test app that shows the problem, and I’ll take a look. Perhaps 
there’s a code path that I’m not seeing. I might be able to suggest a 
workaround if so.

-eric


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (Carbon-dev@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/carbon-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to