atom feed13 messages in net.java.dev.rococoa.usersRe: Invalid memory access of location...
FromSent OnAttachments
Sami NopanenNov 1, 2009 1:08 pm 
Paul LoyNov 1, 2009 2:06 pm 
Sami NopanenNov 1, 2009 2:18 pm 
Andrew ThompsonNov 1, 2009 3:25 pm 
Sami NopanenNov 1, 2009 4:12 pm 
Sami NopanenNov 6, 2009 8:43 am 
Paul LoyNov 6, 2009 9:00 am 
Sami NopanenNov 6, 2009 11:44 am 
Duncan McGregorNov 6, 2009 3:12 pm 
Andrew ThompsonNov 6, 2009 8:00 pm 
Sami NopanenNov 6, 2009 8:51 pm 
Andrew ThompsonNov 7, 2009 7:56 am 
Sami NopanenNov 7, 2009 9:07 am 
Subject:Re: Invalid memory access of location...
From:Sami Nopanen (snop@gmail.com)
Date:Nov 7, 2009 9:07:07 am
List:net.java.dev.rococoa.users

NSBitmapImageRep imageRep = NSBitmapImageRep.CLASS.alloc().initWithCGImage(imageRef).initWithCGImage(imageRef);

//imageRef = 2 here, as initWithCGImage is documented as retaining its argument //imageRep = 1 due to alloc/init

My thinking is that imageRep = 1 here due to NSObject in Rococoa retaining (and because initWithCGImage doesn't return the same instance as alloc). I also notice that accidentally I was calling initWithCGImage twice; that's been fixed now.

Now, I think Rococoa will release both imageRep and imageRef one more time

in finalize, meaning you are OK. Can someone check my counts. I feel like there must be a slightly simpler way to do this.

I don't think Rococoa would be releasing imageRef, as it's just an ID, but it would get released on the ObjC side, due to Rococoa releasing imageRep in finalize.

Sami