• 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: iOS: Preventing a singleton from being deallocated when the app is in the background.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iOS: Preventing a singleton from being deallocated when the app is in the background.


  • Subject: Re: iOS: Preventing a singleton from being deallocated when the app is in the background.
  • From: Greg Parker <email@hidden>
  • Date: Wed, 19 Oct 2016 14:43:11 -0700

> On Oct 19, 2016, at 2:29 PM, Steve Christensen <email@hidden> wrote:
>
> The only difference between your code and mine is that you haven't initialized onceToken = 0 so it has a random value.
>
> I looked around to see if that makes a difference and didn't get much confirmation one way or another. One by Mike Ash (https://www.mikeash.com/pyblog/friday-qa-2014-06-06-secrets-of-dispatch_once.html) mentions, "Note that dispatch_once_t is just a typedef for long, initialized to zero, and with the meaning of other values left up to the implementation."

No difference. C static storage with no initializer is always initialized to zero.


--
Greg Parker     email@hidden <mailto: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


References: 
 >iOS: Preventing a singleton from being deallocated when the app is in the background. (From: Alex Zavatone <email@hidden>)
 >Re: iOS: Preventing a singleton from being deallocated when the app is in the background. (From: Steve Christensen <email@hidden>)
 >Re: iOS: Preventing a singleton from being deallocated when the app is in the background. (From: Alex Zavatone <email@hidden>)
 >Re: iOS: Preventing a singleton from being deallocated when the app is in the background. (From: Steve Christensen <email@hidden>)

  • Prev by Date: Re: iOS: Preventing a singleton from being deallocated when the app is in the background.
  • Next by Date: Re: inconsistencies in view renderings
  • Previous by thread: Re: iOS: Preventing a singleton from being deallocated when the app is in the background.
  • Next by thread: Re: iOS: Preventing a singleton from being deallocated when the app is in the background.
  • Index(es):
    • Date
    • Thread