summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libsanitizer/asan/asan_rtl.cc13
1 files changed, 8 insertions, 5 deletions
diff --git a/libsanitizer/asan/asan_rtl.cc b/libsanitizer/asan/asan_rtl.cc
index 8b28e6aa247..5bafb9a78cf 100644
--- a/libsanitizer/asan/asan_rtl.cc
+++ b/libsanitizer/asan/asan_rtl.cc
@@ -594,11 +594,14 @@ static void AsanInitInternal() {
if (CAN_SANITIZE_LEAKS) {
__lsan::InitCommonLsan();
- if (common_flags()->detect_leaks && common_flags()->leak_check_at_exit) {
- if (flags()->halt_on_error)
- Atexit(__lsan::DoLeakCheck);
- else
- Atexit(__lsan::DoRecoverableLeakCheckVoid);
+ if (common_flags()->detect_leaks) {
+ __lsan::MaybeStartBackgroudLeakCheckingThread();
+ if (common_flags()->leak_check_at_exit) {
+ if (flags()->halt_on_error)
+ Atexit(__lsan::DoLeakCheck);
+ else
+ Atexit(__lsan::DoRecoverableLeakCheckVoid);
+ }
}
}