diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2021-08-12 12:03:24 -0700 |
---|---|---|
committer | Xin Li <delphij@google.com> | 2021-08-12 22:45:46 +0000 |
commit | ad19c87f806d8cc30f3dd38b2cf8b2093eb04d3a (patch) | |
tree | 93d699e33848416768e81412a3b42677c161c6d4 /libc/malloc_debug/malloc_debug.cpp | |
parent | 29045b3d7b8c940c84db5311958ab36530a22ed7 (diff) | |
parent | c75fbc7b8a7a04feacab54cffc1c3129e0e4d769 (diff) |
Merge ab/7633965
Bug: 169893837
Merged-In: Ic7a83fb01a39113d408ed0c95d27f694d5a2649c
Change-Id: I4494985e98790e8934f10c8ba6f6f2207b3050ab
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 609f030bf..d23ab15c3 100644 --- a/libc/malloc_debug/malloc_debug.cpp +++ b/libc/malloc_debug/malloc_debug.cpp @@ -362,10 +362,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, |