On Jan 15, 2014, at 01:29 , Greg Parker <gpar...@apple.com> wrote:

> It sounds more like *B's* retain count had become zero

I’m sure it hadn’t. C’s dealloc was the only place that the CFRetain was 
balanced. I believe I tried commenting out the CFRetain, to see if the crash 
went away, and duly observed B's memory being leaked.

> So if you examine the weak variable's storage via forbidden paths 

FWIW, my comment about the debugger was just an aside. This is the actual code:

> - (void) dealloc {
>       if (_undoProperty)
>               CFRelease ((__bridge CFTypeRef) 
> _undoProperty.objectReference->mutableObject);
> }
> 
> - (id) initWithValue: (id) value forProperty: (BLSTransactionProperty*) 
> property {
>       self = [super init];
>       
>       _undoValue = value;
>       _undoProperty = property;
>       CFRetain ((__bridge CFTypeRef) 
> _undoProperty.objectReference->mutableObject);
>       
>       return self;
> }

and the “objectReference” property is synthesized from:

> @property (nonatomic,weak,readonly)   BLSTransactionObjectReference* 
> objectReference;

There *may* be a forbidden path in the dealloc, but it seemed to me that 'if 
(_undoProperty)’ was true, I should have been able to retrieve the pointer to 
‘mutableObject’, but this wasn’t so. _undoProperty tested true but the object 
was unmessage-able.

Maybe this is a compiler defect in that it’s using the raw ivar value for the 
‘if’ but using ‘objc_loadWeak’ for the message-send.




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to