From: Misha Shneerson Date: Fri, 24 Jul 2015 18:57:21 +0000 (-0700) Subject: Print type of singleton that is requested after destruction X-Git-Tag: v0.52.0~5 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=29d3553cca2cfca3238e2d675a0cedca03528509;p=folly.git Print type of singleton that is requested after destruction Summary: As titled Trying to troubleshoot shutdown problems in HHVM and I see: EventBase::runAfterDelay() callback threw St13runtime_error exception: Raw pointer to a singleton requested after its destruction. Would be much easier to troubleshoot if I know what is it being requested. Reviewed By: @chipturner Differential Revision: D2274497 --- diff --git a/folly/Singleton-inl.h b/folly/Singleton-inl.h index 6bc43ad2..3848ab44 100644 --- a/folly/Singleton-inl.h +++ b/folly/Singleton-inl.h @@ -64,7 +64,9 @@ T* SingletonHolder::get() { if (instance_weak_.expired()) { throw std::runtime_error( - "Raw pointer to a singleton requested after its destruction."); + "Raw pointer to a singleton requested after its destruction." + " Singleton type is: " + + type_.name()); } return instance_ptr_;