• 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: Charilaos Skiadas <email@hidden>
  • Date: Sun, 10 Jul 2005 22:20:05 -0500

Does it still crash if you replace:

    return [shadowCanvas autorelease];

With

    return shadowCanvas;

??

Also, just to make sure, your setImage does look like this?

- (void)setImage:(NSImage *)anImage
{
    if(anImage != image && anImage != nil)
    {
         [image release];
         image = [anImage retain];
    }
}

I have to say, your code looks ok now, but maybe someone with more experience can spot what goes wrong. In general, NSZombieEnabled is what you want to look into to help you deal with autorelease issues. This is probably an autorelease issue. That's why your app crashes whenever the autorelease pool gets a chance to be released, which may vary.
On Jul 10, 2005, at 9:55 PM, Matt Ball wrote:


Actually, after further experimentation, it doesn't seem to be
consistent on where the NSLogs stop. Sometimes it gets all the way to
"End drawWithFrame" before crashing...

- 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
  • Follow-Ups:
    • Re: Why does this leak memory?
      • From: Matt Ball <email@hidden>
References: 
 >Why does this leak memory? (From: Matt Ball <email@hidden>)
 >Re: Why does this leak memory? (From: Matt Ball <email@hidden>)
 >Re: Why does this leak memory? (From: Zach Wily <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: Documentation frustrations
  • Next by Date: Re: Why does this leak memory?
  • Previous by thread: Re: Why does this leak memory?
  • Next by thread: Re: Why does this leak memory?
  • Index(es):
    • Date
    • Thread