Commit 29d3553c authored by Misha Shneerson's avatar Misha Shneerson Committed by facebook-github-bot-4

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
parent a4fc31fc
......@@ -64,7 +64,9 @@ T* SingletonHolder<T>::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_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment