Make folly::Singleton's destruction happen earlier
authorAndrii Grynenko <andrii@fb.com>
Thu, 4 Dec 2014 01:26:45 +0000 (17:26 -0800)
committerDave Watson <davejwatson@fb.com>
Thu, 11 Dec 2014 16:00:35 +0000 (08:00 -0800)
commit24b9221197183fa3a54426814f1df04ed2214fd4
treefce185376e523780123fb7035d8c86ff57b25e32
parent44e48457cd329fe0a467c5bf9a8b8d514c8e6e0d
Make folly::Singleton's destruction happen earlier

Summary: Schedule destroyInstances to be executed via atexit in registrationComplete. registrationComplete is called from main(), so this makes sure folly::Singleton's will be destoyed before all singletons constructed before main() (which should cover all third-party libraries' singletons).

Test Plan: unit test

Reviewed By: chip@fb.com

Subscribers: trunkagent, njormrod, folly-diffs@

FB internal diff: D1717963

Tasks: 5666654

Signature: t1:1717963:1417659478:c50c271d1786be75499565f6ab9c0a1a6f6f347d
folly/experimental/Singleton.h