[Lldb-commits] [lldb] r164184 - /lldb/trunk/source/Core/ModuleList.cpp

Greg Clayton gclayton at apple.com
Tue Sep 18 16:50:22 PDT 2012


Author: gclayton
Date: Tue Sep 18 18:50:22 2012
New Revision: 164184

URL: http://llvm.org/viewvc/llvm-project?rev=164184&view=rev
Log:
<rdar://problem/12125274>

Intentionally leak the module list to avoid unnecessary freeing of modules + object files + symbol files when the program is exiting.


Modified:
    lldb/trunk/source/Core/ModuleList.cpp

Modified: lldb/trunk/source/Core/ModuleList.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ModuleList.cpp?rev=164184&r1=164183&r2=164184&view=diff
==============================================================================
--- lldb/trunk/source/Core/ModuleList.cpp (original)
+++ lldb/trunk/source/Core/ModuleList.cpp Tue Sep 18 18:50:22 2012
@@ -643,8 +643,14 @@
 static ModuleList &
 GetSharedModuleList ()
 {
-    static ModuleList g_shared_module_list;
-    return g_shared_module_list;
+    // NOTE: Intentionally leak the module list so a program doesn't have to
+    // cleanup all modules and object files as it exits. This just wastes time
+    // doing a bunch of cleanup that isn't required.
+    static ModuleList *g_shared_module_list = NULL;
+    if (g_shared_module_list == NULL)
+        g_shared_module_list = new ModuleList(); // <--- Intentional leak!!!
+    
+    return *g_shared_module_list;
 }
 
 bool





More information about the lldb-commits mailing list