• 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: The released object is not releasing memory
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: The released object is not releasing memory


  • Subject: Re: The released object is not releasing memory
  • From: Scott Ribe <email@hidden>
  • Date: Mon, 14 May 2007 09:14:11 -0600
  • Thread-topic: The released object is not releasing memory

> I have checked for retainCount for "bmp" before releasing it. The retain
> count is 2.

Yes, it was probably retained by graphicsContextWithBitmapImageRep because
the context will need the rep during the context's lifetime. Note that
graphicsContextWithBitmapImageRep returns a context which has been
autoreleased, and therefore won't be freed, and therefore won't release its
reference to the rep, until after your code has run and control returns to
the event loop. (The setCurrentContext and restoreGraphicsState calls
probably retain and release the context you created, but they might retain
and autorelease.)

You need to stop trying to outguess the libraries' memory management and
study this until you understand it:

<http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/index.
html>

--
Scott Ribe
email@hidden
http://www.killerbytes.com/
(303) 722-0567 voice


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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

  • Follow-Ups:
    • [Solved]RE: The released object is not releasing memory
      • From: Vinay Prabhu <email@hidden>
References: 
 >RE: The released object is not releasing memory (From: Vinay Prabhu <email@hidden>)

  • Prev by Date: Re: Accessing instance variables from value transformer
  • Next by Date: Re: Accessing instance variables from value transformer
  • Previous by thread: RE: The released object is not releasing memory
  • Next by thread: [Solved]RE: The released object is not releasing memory
  • Index(es):
    • Date
    • Thread