Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2382)

Unified Diff: base/lazy_instance.cc

Issue 3956003: ThreadRestrictions: leak the thread local variable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: better impl Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: base/lazy_instance.cc
diff --git a/base/lazy_instance.cc b/base/lazy_instance.cc
index 957482cbb2addd2815e857dea44e62748d13a24a..eb710615e313de397b312848393f97f99b33b2ee 100644
--- a/base/lazy_instance.cc
+++ b/base/lazy_instance.cc
@@ -37,7 +37,8 @@ void LazyInstanceHelper::CompleteInstance(void* instance, void (*dtor)(void*)) {
base::subtle::Release_Store(&state_, STATE_CREATED);
// Make sure that the lazily instantiated object will get destroyed at exit.
- base::AtExitManager::RegisterCallback(dtor, instance);
+ if (dtor)
+ base::AtExitManager::RegisterCallback(dtor, instance);
}
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698