diff options
| author | Greg Clayton <gclayton@apple.com> | 2012-09-18 23:50:22 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2012-09-18 23:50:22 +0000 |
| commit | 6f4d8af713da3e06602f13ccc7e89ecc33b88f16 (patch) | |
| tree | d7cdff90fb1aad71b066698914916f38a77f062f | |
| parent | dfa424c593a057ec3692576c81b735442f9a3ac9 (diff) | |
| download | bcm5719-llvm-6f4d8af713da3e06602f13ccc7e89ecc33b88f16.tar.gz bcm5719-llvm-6f4d8af713da3e06602f13ccc7e89ecc33b88f16.zip | |
<rdar://problem/12125274>
Intentionally leak the module list to avoid unnecessary freeing of modules + object files + symbol files when the program is exiting.
llvm-svn: 164184
| -rw-r--r-- | lldb/source/Core/ModuleList.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
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 |

