NSBitMapImageRep - memory footprint
NSBitMapImageRep - memory footprint
- Subject: NSBitMapImageRep - memory footprint
- From: "Bruce Johnson" <email@hidden>
- Date: Thu, 31 Aug 2006 20:43:35 -0700
When I do something like this in a subclass of an NSImage--
[self initWithContentsOfFile: pathToFile];
//[[self representations] count] == 1
[self removeRepresentation: [[self representations] objectAtIndex: 0]];
//[[self representations] count] == 0 no more reps hanging about
//....code to to create my own rep and then add it to the NSImage
colorImageRep = [[NSBitmapImageRep alloc] initWithData: tiffData];
[self addRepresentation: colorImageRep];
[tiffData release];
[colorImageRep release];
Is it safe to assume that the removed representation is forever gone
and it's memory freed?
Or do I need to somehow release this reps memory footprint to avoid a
memory leak?
And that by adding a rep to the NSImage it is retained, so I then must
release it to avoid an extra increment in the retain count.
--
----
Bruce Johnson
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden