• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I debug weak_unregister_no_lock?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: How do I debug weak_unregister_no_lock?
      • From: Quincey Morris <email@hidden>
References: 
 >How do I debug weak_unregister_no_lock? (From: Gideon King <email@hidden>)
 >Re: How do I debug weak_unregister_no_lock? (From: Gideon King <email@hidden>)
 >Re: How do I debug weak_unregister_no_lock? (From: Quincey Morris <email@hidden>)
 >Re: How do I debug weak_unregister_no_lock? (From: Kyle Sluder <email@hidden>)
 >Re: How do I debug weak_unregister_no_lock? (From: Ken Thomases <email@hidden>)
 >Re: How do I debug weak_unregister_no_lock? (From: Quincey Morris <email@hidden>)
 >Re: How do I debug weak_unregister_no_lock? (From: Greg Parker <email@hidden>)

  • Prev by Date: Re: How do I debug weak_unregister_no_lock?
  • Next by Date: Re: How do I debug weak_unregister_no_lock?
  • Previous by thread: Re: How do I debug weak_unregister_no_lock?
  • Next by thread: Re: How do I debug weak_unregister_no_lock?
  • Index(es):
    • Date
    • Thread