Remove DFATAL from folly::Singleton::try_get()
authorAndrii Grynenko <andrii@fb.com>
Thu, 29 Oct 2015 21:33:02 +0000 (14:33 -0700)
committerfacebook-github-bot-1 <folly-bot@fb.com>
Thu, 29 Oct 2015 22:20:19 +0000 (15:20 -0700)
commitc2dc18ba4b311dff25db852eadf1b774e73f1158
treeb29017bceec79efac1dcf7d232a2f29796b037e3
parent99de4c5fde6fce17ac9dab77b2b99ceffce999dc
Remove DFATAL from folly::Singleton::try_get()

Summary: try_get() API is confusing right now, because it returns nullptr in release, but crashes in debug build. Users end up handling nullptr returns, yet their code crashes in debug builds for no reason. See https://www.facebook.com/groups/fbthrift/permalink/1222120054481561/ for an example.

If we want to keep the crashing API we should probably name it differently and make it crash both in debug and release.

Reviewed By: dhruvbird

Differential Revision: D2587818

fb-gh-sync-id: 5834bfa08eb5d9bc6db1c5edf4a048a5b1d3212c
folly/Singleton.h