[Lldb-commits] [lldb] r268559 - Intentionally leak the ASTSourceMap instead of destroying it when LLDB quits.

Sean Callanan via lldb-commits lldb-commits at lists.llvm.org
Wed May 4 14:42:55 PDT 2016


Author: spyffe
Date: Wed May  4 16:42:55 2016
New Revision: 268559

URL: http://llvm.org/viewvc/llvm-project?rev=268559&view=rev
Log:
Intentionally leak the ASTSourceMap instead of destroying it when LLDB quits.

<rdar://problem/25959792>

Modified:
    lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp

Modified: lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp?rev=268559&r1=268558&r2=268559&view=diff
==============================================================================
--- lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp (original)
+++ lldb/trunk/source/Symbol/ClangExternalASTSourceCommon.cpp Wed May  4 16:42:55 2016
@@ -19,8 +19,9 @@ typedef llvm::DenseMap<clang::ExternalAS
 
 static ASTSourceMap &GetSourceMap()
 {
-    static ASTSourceMap s_source_map;
-    return s_source_map;
+    // Intentionally leaked to avoid problems with global destructors.
+    static ASTSourceMap *s_source_map = new ASTSourceMap;
+    return *s_source_map;
 }
 
 ClangExternalASTSourceCommon *




More information about the lldb-commits mailing list