• 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: __weak pointer collection firing prematurely???
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: __weak pointer collection firing prematurely???


  • Subject: Re: __weak pointer collection firing prematurely???
  • From: Britt Durbrow <email@hidden>
  • Date: Mon, 13 Aug 2012 01:37:57 -0700

On Aug 13, 2012, at 1:00 AM, Quincey Morris <email@hidden> wrote:

> On Aug 13, 2012, at 00:04 , Britt Durbrow <email@hidden> wrote:
>
>> This is the exact line of code in question:
>>
>> TrDocument *document=(TrDocument *)__RPCPersistentInfo__pool->document;
>>
>> The document object in question is, when this happens, still in the middle of it's init method when that __weak __RPCPersistentInfo__pool->document variable gets zeroed out.
>
> There's nothing about the fact that the document is executing a method that prevents it from being deallocated before the method ends. It's really only a question of whether there's a strong reference being maintained at the 'init' call site for the duration of the 'init' call (assuming that, since the document is in the process of being created, there can't be any strong reference anywhere else yet).
>
> So, before focusing too much on the the load of the weak reference, I'd suggest you implement a 'dealloc' override in the document class, set a breakpoint there, and see what's actually triggering deallocation.
>
>

Did that - no go. The dealloc method is not being called. Also, there's a printf statement in the dealloc method as well, so it's not just that the debugger is missing the breakpoint; the document object is in fact not being deallocated.



_______________________________________________

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

References: 
 >__weak pointer collection firing prematurely??? (From: Britt Durbrow <email@hidden>)
 >Re: __weak pointer collection firing prematurely??? (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: Core Graphics optimisation
  • Next by Date: Alternative method for makeViewWithIdentifier
  • Previous by thread: Re: __weak pointer collection firing prematurely???
  • Next by thread: Re: __weak pointer collection firing prematurely???
  • Index(es):
    • Date
    • Thread