summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/malloc_debug.cpp
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-07-16 01:01:25 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2021-07-16 01:01:25 +0000
commitbf83896cf9abcfe32aaa085b0cf9730ad64e01de (patch)
treea1a5bfa23949cf21e41ae2acc9b7ef75c1c01fd6 /libc/malloc_debug/malloc_debug.cpp
parent77736b469e139389bec707758f6307685286de52 (diff)
parente9b672b3e0f94f020689eb9df1195ef410c9c1f4 (diff)
Snap for 7553867 from e9b672b3e0f94f020689eb9df1195ef410c9c1f4 to sc-release
Change-Id: Iae9599c540018e82bfb106a2845b3f8a8f6f684f
Diffstat (limited to 'libc/malloc_debug/malloc_debug.cpp')
-rw-r--r--libc/malloc_debug/malloc_debug.cpp7
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,