summaryrefslogtreecommitdiffstats
path: root/base/lazy_instance.cc
diff options
context:
space:
mode:
authorevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-21 20:41:47 +0000
committerevan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-21 20:41:47 +0000
commitdcc6933f480397af42af5fa08d40475c13d266e8 (patch)
treeee6e4ca772e87f9ce27f60315895e7d9392d814e /base/lazy_instance.cc
parent363dc7f1f2025475b418bfee73efe3030d9b1313 (diff)
downloadchromium_src-dcc6933f480397af42af5fa08d40475c13d266e8.zip
chromium_src-dcc6933f480397af42af5fa08d40475c13d266e8.tar.gz
chromium_src-dcc6933f480397af42af5fa08d40475c13d266e8.tar.bz2
ThreadRestrictions: leak the thread local variable
LazyInstances are destroyed by the AtExitManager, but we have threads that outlive the AtExitManager that could potentially access this. Review URL: http://codereview.chromium.org/3956003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@63410 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/lazy_instance.cc')
-rw-r--r--base/lazy_instance.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/base/lazy_instance.cc b/base/lazy_instance.cc
index 957482c..eb71061 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