don't destory defaultElfCache in exit handlers
authorPhilip Pronin <philipp@fb.com>
Fri, 29 Apr 2016 00:21:06 +0000 (17:21 -0700)
committerFacebook Github Bot 2 <facebook-github-bot-2-bot@fb.com>
Fri, 29 Apr 2016 00:35:23 +0000 (17:35 -0700)
Summary:
As it might be used during global destruction (for example, to
symbolize unhandled exception happened at that time).

Reviewed By: luciang, ot

Differential Revision: D3238303

fb-gh-sync-id: 39d8a6f99d95e700586349436e961f3624c95718
fbshipit-source-id: 39d8a6f99d95e700586349436e961f3624c95718

folly/experimental/symbolizer/Symbolizer.cpp

index 926e5ffe99e99cb292fee230aa409e23b702b3ed..e42e4f5832d7e17487bce64403965465ae596aac 100644 (file)
@@ -171,8 +171,8 @@ bool parseProcMapsLine(StringPiece line,
 
 ElfCache* defaultElfCache() {
   static constexpr size_t defaultCapacity = 500;
-  static ElfCache cache(defaultCapacity);
-  return &cache;
+  static auto cache = new ElfCache(defaultCapacity);
+  return cache;
 }
 
 }  // namespace