| From | Sent On | Attachments |
|---|
| 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 | |
Refine Search
| From | Sent On | Attachments |
|---|---|---|
| Sami Nopanen | Nov 1, 2009 1:08 pm | |
| Paul Loy | Nov 1, 2009 2:06 pm | |
| Sami Nopanen | Nov 1, 2009 2:18 pm | |
| Andrew Thompson | Nov 1, 2009 3:25 pm | |
| Sami Nopanen | Nov 1, 2009 4:12 pm | |
| Sami Nopanen | Nov 6, 2009 8:43 am | |
| Paul Loy | Nov 6, 2009 9:00 am | |
| Sami Nopanen | Nov 6, 2009 11:44 am | |
| Duncan McGregor | Nov 6, 2009 3:12 pm | |
| Andrew Thompson | Nov 6, 2009 8:00 pm | |
| Sami Nopanen | Nov 6, 2009 8:51 pm | |
| Andrew Thompson | Nov 7, 2009 7:56 am | |
| Sami Nopanen | Nov 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

