• 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: Why does this leak memory?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why does this leak memory?


  • Subject: Re: Why does this leak memory?
  • From: Tito Ciuro <email@hidden>
  • Date: Sun, 10 Jul 2005 19:56:58 -0400

Hi Matt,

If you alloc/init 'resizedImage' and don't retain/release/autorelease 'resizedImage' anywhere in the code, then returning [resizedImage autorelease] should be fine. Check the code.

-- Tito

On 10/07/2005, at 19:51, Matt Ball wrote:

Tony - I still get leaks from that code.

Tito - When I do that, my app crashes.

Also, there is a lot more code in the function that performs other
operations. I have currently commented all the rest out so that I can
focus on one set of leaks at a time. However, I will eventually add
them back in, so I can't just return resizedImage.

- Matt Ball

On 7/10/05, Tony Cate <email@hidden> wrote:


On Jul 10, 2005, at 6:34 PM, Matt Ball wrote:


[resizedImage unlockFocus];
    image = [resizedImage retain];
    [resizedImage release];



What happens if you rewrite this to:

image = resizedImage;
[image retain];
[resizedImage release];


 _______________________________________________
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


_______________________________________________ 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
References: 
 >Why does this leak memory? (From: Matt Ball <email@hidden>)
 >Re: Why does this leak memory? (From: Matt Ball <email@hidden>)

  • Prev by Date: Re: Why does this leak memory?
  • Next by Date: Re: "untitled" vs "Untitled"
  • Previous by thread: Re: Why does this leak memory?
  • Next by thread: Re: Why does this leak memory?
  • Index(es):
    • Date
    • Thread