diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-07-16 01:00:32 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-07-16 01:00:32 +0000 |
commit | 2fba3a8743ae3e7eb00956ab00f15adbd22c10c5 (patch) | |
tree | a1a5bfa23949cf21e41ae2acc9b7ef75c1c01fd6 /libc/malloc_debug/malloc_debug.cpp | |
parent | d4e9d430965d9854d57330dcdddc4a10942c2d1e (diff) | |
parent | e9b672b3e0f94f020689eb9df1195ef410c9c1f4 (diff) |
Snap for 7553867 from e9b672b3e0f94f020689eb9df1195ef410c9c1f4 to sc-d1-release
Change-Id: I01b1aa7bb566c94ce75543bb32c3bc11a8ed4c71
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, |