• 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: Matt Ball <email@hidden>
  • Date: Mon, 11 Jul 2005 02:37:38 -0400

I noticed that my NSImage leaks were only occurring after I edited a
cell, so I replaced [self image] with image in my editWithFrame and
selectWithFrame methods, and the image leaks went away! I'm still
getting a couple of non-NSImage leaks from the main app, but I hope
I'll be able to track those down.

- Matt Ball

On 7/11/05, Matt Ball <email@hidden> wrote:
> I think I may be on to something...
>
> I changed:
> - (NSImage *)image
> {
>         return [[image retain] autorelease];
> }
>
> to
>
> - (NSImage *)image
> {
>         return [image retain];
> }
>
> and it seems to be working better. I now have only 6 leaks as opposed
> to > 150. I don't know if this helps the situation at all, but I
> thought I'd let you know. Let me know if this triggers a Eureka moment
> :)
>
> - Matt Ball
>
> On 7/11/05, Charilaos Skiadas <email@hidden> wrote:
> >
> >
> > On Jul 11, 2005, at 12:48 AM, Matt Ball wrote:
> >
> > Oh, and in addition: If I change it so that it resizes the image and
> > then returns resizedImage, it works fine. I think the weird error is
> > because the unresized-image is larger than the table row, so it messes
> > things up. However, when I return [resizedImage autorelease]; instead
> > of return resizedImage;, I get the same crash we were dealing with
> > before...
> >
> > and still the same problem if you just return it, but add a release at the
> > end of the tableView call instead?
> > If it is not a pool overflow problem, then I really don't see what's wrong,
> > sorry.
> >
> > - Matt Ball
> >
> > Haris
> >
> >
> >
>
 _______________________________________________
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: Charilaos Skiadas <email@hidden>)
 >Re: Why does this leak memory? (From: Matt Ball <email@hidden>)
 >Re: Why does this leak memory? (From: Charilaos Skiadas <email@hidden>)
 >Re: Why does this leak memory? (From: Matt Ball <email@hidden>)
 >Re: Why does this leak memory? (From: Charilaos Skiadas <email@hidden>)
 >Re: Why does this leak memory? (From: Matt Ball <email@hidden>)
 >Re: Why does this leak memory? (From: Charilaos Skiadas <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: Newbie question on NSDecimals
  • Previous by thread: Re: Why does this leak memory?
  • Next by thread: Re: Why does this leak memory?
  • Index(es):
    • Date
    • Thread