diff options
Diffstat (limited to 'chrome/browser/browser_process_impl.cc')
-rw-r--r-- | chrome/browser/browser_process_impl.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index a48c7e2..6825a2e 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -12,6 +12,7 @@ #include "base/bind_helpers.h" #include "base/command_line.h" #include "base/debug/alias.h" +#include "base/debug/leak_annotations.h" #include "base/path_service.h" #include "base/prefs/json_pref_store.h" #include "base/prefs/pref_registry_simple.h" @@ -341,6 +342,14 @@ unsigned int BrowserProcessImpl::ReleaseModule() { print_job_manager_->Shutdown(); #endif +#if defined(LEAK_SANITIZER) + // Check for memory leaks now, before we start shutting down threads. Doing + // this early means we won't report any shutdown-only leaks (as they have + // not yet happened at this point). + // If leaks are found, this will make the process exit immediately. + __lsan_do_leak_check(); +#endif + CHECK(base::MessageLoop::current()->is_running()); #if defined(OS_MACOSX) |