• 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: EXC_BAD_ACCESS when -fobjc-gc is on (Was: Memory corruption ...)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: EXC_BAD_ACCESS when -fobjc-gc is on (Was: Memory corruption ...)


  • Subject: Re: EXC_BAD_ACCESS when -fobjc-gc is on (Was: Memory corruption ...)
  • From: "Stephen J. Butler" <email@hidden>
  • Date: Wed, 7 Oct 2009 13:30:12 -0500

On Wed, Oct 7, 2009 at 1:13 PM, Gabriel Zachmann <email@hidden> wrote:
> - (CALayer *) makeImageLayer: (NSString *) img_name inRect: (NSSize) size
> {
>    // [snip]
>    CGImageRef cgImage = CGImageSourceCreateImageAtIndex( sourceRef, 0, NULL
> );
>    // [snip]
>    imgLayer.contents = (id) cgImage;
>    // [snip]
>    CGImageRelease( cgImage );
>
>    return imgLayer;
> }

I think this is your problem right here. In a GC environment CALayer
isn't going to retain its content, it stores a strong reference
instead. But cgImage isn't collectable, so the strong reference does
nothing. Look at the documentaiton for CFMakeCollectable.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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

References: 
 >EXC_BAD_ACCESS when -fobjc-gc is on (Was: Memory corruption ...) (From: Gabriel Zachmann <email@hidden>)

  • Prev by Date: Re: Constructive Criticism
  • Next by Date: Re: [iPhone] Application running for the very first time...
  • Previous by thread: EXC_BAD_ACCESS when -fobjc-gc is on (Was: Memory corruption ...)
  • Next by thread: Re: EXC_BAD_ACCESS when -fobjc-gc is on (Was: Memory corruption ...)
  • Index(es):
    • Date
    • Thread