From: Philip Pronin Date: Fri, 29 Apr 2016 00:21:06 +0000 (-0700) Subject: don't destory defaultElfCache in exit handlers X-Git-Tag: 2016.07.26~301 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=78b48f1539be4c560198b8b6648e02c2a6934084;p=folly.git don't destory defaultElfCache in exit handlers 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 --- diff --git a/folly/experimental/symbolizer/Symbolizer.cpp b/folly/experimental/symbolizer/Symbolizer.cpp index 926e5ffe..e42e4f58 100644 --- a/folly/experimental/symbolizer/Symbolizer.cpp +++ b/folly/experimental/symbolizer/Symbolizer.cpp @@ -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