From 6f4d8af713da3e06602f13ccc7e89ecc33b88f16 Mon Sep 17 00:00:00 2001 From: Greg Clayton Date: Tue, 18 Sep 2012 23:50:22 +0000 Subject: Intentionally leak the module list to avoid unnecessary freeing of modules + object files + symbol files when the program is exiting. llvm-svn: 164184 --- lldb/source/Core/ModuleList.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'lldb/source/Core/ModuleList.cpp') diff --git a/lldb/source/Core/ModuleList.cpp b/lldb/source/Core/ModuleList.cpp index 657ee693457..13e30f6a146 100644 --- a/lldb/source/Core/ModuleList.cpp +++ b/lldb/source/Core/ModuleList.cpp @@ -643,8 +643,14 @@ ModuleList::GetIndexForModule (const Module *module) const 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 -- cgit v1.2.3