diff options
-rw-r--r-- | base/at_exit.cc | 2 | ||||
-rw-r--r-- | base/singleton_dll_unittest.cc | 4 |
2 files changed, 2 insertions, 4 deletions
diff --git a/base/at_exit.cc b/base/at_exit.cc index c43e9ac..1f56057 100644 --- a/base/at_exit.cc +++ b/base/at_exit.cc @@ -62,6 +62,7 @@ AtExitManager::~AtExitManager() { AutoLock lock(lock_); ProcessCallbacks(); g_atexit_queue = NULL; + g_atexit_lock = NULL; } void AtExitManager::RegisterCallback(AtExitCallbackType func) { @@ -74,7 +75,6 @@ void AtExitManager::RegisterCallback(AtExitCallbackType func) { g_atexit_queue->push(func); } -// Calls the functions registered with AtExit in LIFO order. void AtExitManager::ProcessCallbacksNow() { DCHECK(NULL != g_atexit_lock); if (!g_atexit_lock) diff --git a/base/singleton_dll_unittest.cc b/base/singleton_dll_unittest.cc index 4e0ec3a..78b2a7c 100644 --- a/base/singleton_dll_unittest.cc +++ b/base/singleton_dll_unittest.cc @@ -33,7 +33,7 @@ namespace { -base::AtExitManager* g_exit_manager = NULL; +base::AtExitManager g_exit_manager; } // namespace @@ -41,13 +41,11 @@ BOOL APIENTRY DllMain(HMODULE module, DWORD reason_for_call, LPVOID reserved) { switch (reason_for_call) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(module); - g_exit_manager = new base::AtExitManager(); break; case DLL_THREAD_ATTACH: case DLL_THREAD_DETACH: break; case DLL_PROCESS_DETACH: - delete g_exit_manager; break; } return TRUE; |