diff options
author | Scott Lobdell <slobdell@google.com> | 2021-07-27 17:02:00 +0000 |
---|---|---|
committer | Scott Lobdell <slobdell@google.com> | 2021-07-27 17:02:01 +0000 |
commit | 57d945d1bb7fc8e1f60f151e7bac6fc1ed998053 (patch) | |
tree | dff561187c055ba84a038dc01d6fd51dc5c6fb48 /libc/malloc_debug/malloc_debug.cpp | |
parent | bb5475827153cdd2abecf4f83272ffadd1e7ed18 (diff) | |
parent | bf83896cf9abcfe32aaa085b0cf9730ad64e01de (diff) |
Merge SP1A.210723.002
Change-Id: I0fe27377cab01d329a1e8fbe80c2f9d8a0e35a30
Diffstat (limited to 'libc/malloc_debug/malloc_debug.cpp')
-rw-r--r-- | libc/malloc_debug/malloc_debug.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libc/malloc_debug/malloc_debug.cpp b/libc/malloc_debug/malloc_debug.cpp index b27853a9a..e435f8efb 100644 --- a/libc/malloc_debug/malloc_debug.cpp +++ b/libc/malloc_debug/malloc_debug.cpp @@ -385,10 +385,9 @@ void debug_finalize() { backtrace_shutdown(); - delete g_debug; - g_debug = nullptr; - - DebugDisableFinalize(); + // In order to prevent any issues of threads freeing previous pointers + // after the main thread calls this code, simply leak the g_debug pointer + // and do not destroy the debug disable pthread key. } void debug_get_malloc_leak_info(uint8_t** info, size_t* overall_size, size_t* info_size, |