Re: How do I debug weak_unregister_no_lock?
Re: How do I debug weak_unregister_no_lock?
- Subject: Re: How do I debug weak_unregister_no_lock?
- From: Quincey Morris <email@hidden>
- Date: Wed, 15 Jan 2014 02:00:26 -0800
On Jan 15, 2014, at 01:29 , Greg Parker <email@hidden> 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 (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