summaryrefslogtreecommitdiff
path: root/libc/malloc_debug/malloc_debug.cpp
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2021-08-26 02:17:34 -0700
committerLinux Build Service Account <lnxbuild@localhost>2021-08-26 02:17:34 -0700
commit800092dfdc59acdf5a7594e0576e26d4e4d9dcac (patch)
treef71f01e736d9b70e5856fd9bbdf0bf8bcda959a6 /libc/malloc_debug/malloc_debug.cpp
parent555d228b48c09d9372395a9f66f4788e65782d6d (diff)
parent50ea1df5ef98170dec5ac2834b6587fae1d11e67 (diff)
Merge 50ea1df5ef98170dec5ac2834b6587fae1d11e67 on remote branch
Change-Id: Ib8d2e57184758c537de47c68b5e8233cc6a34b5b
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 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,