• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSBitMapImageRep - memory footprint
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Document based app, where to put other windows?
  • Next by Date: Re: Imitating Mail's Interface
  • Previous by thread: Re: Document based app, where to put other windows?
  • Index(es):
    • Date
    • Thread