• 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
Re: NSImage & memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImage & memory


  • Subject: Re: NSImage & memory
  • From: Jeremy Rotsztain <email@hidden>
  • Date: Tue, 17 Jul 2007 13:50:11 -0400


gotcha. that makes sense, i'm not taking ownership of the object, so i don't need to release it.
thanks for the quick responses.


On Jul 17, 2007, at 1:41 PM, Uli Kusterer wrote:


On 17.07.2007, at 19:20, Jeremy Rotsztain wrote:

// generate the image
tmpImg = [[ NSImage alloc] initWithSize:imgNewSize ]];

General rule: Send us the code you actually compiled, just in case you have a typo that you're overlooking (e.g. a comma instead of a semicolon can be devilishly hard to track down). The line above should not even compile.


// write image to disk
NSData *tmpImgTIFFData = [ tmpImg TIFFRepresentation ];

Does it say "copy", "retain" or "init" anywhere in that call? No? So it's an object owned by someone else, but not you. Probably some Autorelease Pool or tmpImg own this NSData.


[ tmpImgTIFFData writeToFile:@"/Users/kiev/Desktop/ FlickrComposition.tiff" atomically:YES ];

// release data
[ tmpImgTIFFData release ];

What are you doing releasing an object owned by someone else?

Cheers,
-- M. Uli Kusterer
http://www.zathras.de





_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSImage & memory (From: Jeremy Rotsztain <email@hidden>)
 >Re: NSImage & memory (From: Uli Kusterer <email@hidden>)

  • Prev by Date: Re: NSImage & memory
  • Next by Date: NSNumberFormatter and 10.4 behavior
  • Previous by thread: Re: NSImage & memory
  • Next by thread: NSNumberFormatter and 10.4 behavior
  • Index(es):
    • Date
    • Thread