• 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: CoreImage: Newbie can't find memory leak
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CoreImage: Newbie can't find memory leak


  • Subject: Re: CoreImage: Newbie can't find memory leak
  • From: Jack Nutting <email@hidden>
  • Date: Wed, 15 Feb 2006 10:57:47 +0100

Hi Chris,

The code you've posted looks OK.  However, it's hard to know about what
you've left out, particularly here:

- (void)getCurrentImage : (NSNotification *)note
> {
>     CIImage *ciThreshold;
>
>     // SNIP. ciThreshold is correctly created here, no problems there. //
>
>     [compositor addImage:ciThreshold];
> }


Are you really quite sure ciThreshold is being created correctly?  My first
guess here is that it's being created with a copy or alloc, and no matching
autorelease.

Another possibility is that whatever's happening inside of
+[ImageMethodLibrary compositeImage:overlayingImage:] is leaking something.

So I looked at the retain count. And it's completely off-the-wall.
> Most of the time the retain count is 3 after I tried to get rid of it,
> but sometimes it'll be 2! How on EARTH it can vary is beyond me. Even
> worse, because an Autorelease is scheduled somewhere (and it's not me
> that's done it), if I try and hack it to force a release by simply
> calling [composite release] the amount of times it appears in the
> retainCount, I end up with the NSPopAutoReleasePool crashing the
> program.


Looking at the retain count is almost never helpful, I'm afraid.  There is
always a possibility that other objects you're unaware of may have a pointer
to your object and have retained it.  All you can do is examine your own
code and assumptions about what's happening, and see if you've overlooked
something.

--
// jack
// http://www.nuthole.com
 _______________________________________________
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: 
 >CoreImage: Newbie can't find memory leak (From: Chris Lewis <email@hidden>)

  • Prev by Date: Re: CoreImage: Newbie can't find memory leak
  • Next by Date: Other Cocoa resources (was Re: why does this leak?)
  • Previous by thread: Re: CoreImage: Newbie can't find memory leak
  • Next by thread: keyDown: and Japanese input methods
  • Index(es):
    • Date
    • Thread