Re: Garbage collected and non-garbage collected
Re: Garbage collected and non-garbage collected
- Subject: Re: Garbage collected and non-garbage collected
- From: Greg Parker <email@hidden>
- Date: Thu, 12 Mar 2009 11:45:09 -0700
On Mar 12, 2009, at 11:33 AM, Robert Mullen wrote:
OK, I took a step back today and reconvened the knowledge you guys
have shared, reread the Hillegass chapter on GC (what a great
book!!), and reviewed the approaches I had taken. One thing that
jumped out at me was that I had not revisited the flags:
_SM2DGraphView_Private =
NSAllocateCollectable(sizeof(SM2DPrivateData), NSScannedOption|
NSCollectorDisabledOption);
with the __strong declaration on the private data object. If I use
both flags as shown above (which is what was originally suggested by
Greg Parker AND the __strong declaration on
#define myPrivateData ((SM2DPrivateData __strong *)
_SM2DGraphView_Private)
the framework compiles, my project compiles with it and miracle of
miracles it appears to run fully. Obviously I need to put this
through its paces but this is the only time I have had a successful
run of this inclusive project with GC on. Thanks to everybody who
added a little bit, each piece has helped me to understand the whole
better even if the project eventually fails.
Can anybody see obvious problems in what I did above?
Yes. __strong should be part of the ivar declaration, not the #define.
--
Greg Parker email@hidden Runtime Wrangler
_______________________________________________
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