I've built a video viewer that is a Safari plugin that displays video from networked devices. The viewer reads bitmap images, prepares them, and sets them on the NSImageView object as follows:
NSBitmapImage *bmImg = [[NSBitmapImage alloc] initWithBitmapDataPlanes: . . .]
NSImage *img = [[NSImage alloc] init];
[img addRepresentation:bmImg];
The image is added to the NSImageView via "setImage" on the main thread. The video displays fine.
My question is, shouldn't the act of setting the next image via "setImage" cause the prior image and its associated bitmap image to be released and subsequently freed?
Do I need to perform the [img release] on the alloc'd image myself?
Do I need to remove the image rep from the img and release it also?
Thanks in advance.