diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-07-17 03:01:52 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2021-07-17 03:01:52 +0000 |
commit | 876cdbaea6446f1a68788612ee23749f82851deb (patch) | |
tree | a1a5bfa23949cf21e41ae2acc9b7ef75c1c01fd6 /libc/malloc_debug/malloc_debug.cpp | |
parent | d1d2c79d95255747f0bbf24dfa71a4a6e5bb1ad2 (diff) | |
parent | bde9d6ba82b8c8b8cbdf116d0ad615ccd2592e98 (diff) |
Snap for 7557463 from bde9d6ba82b8c8b8cbdf116d0ad615ccd2592e98 to sc-v2-release
Change-Id: Ie77ad116ed500c73b2eaaedef51977086f6d8bae
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, |