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

Unified Diff: base/lazy_instance.h

Issue 1812: Just by implementing a destructor (even if it's not doing anything), MSVC wil... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/lazy_instance.h
===================================================================
--- base/lazy_instance.h (revision 1839)
+++ base/lazy_instance.h (working copy)
@@ -64,7 +64,8 @@
};
explicit LazyInstanceHelper(LinkerInitialized x) { /* state_ is 0 */ }
- ~LazyInstanceHelper() { }
+ // Declaring a destructor (even if it's empty) will cause MSVC to register a
+ // static initializer to register the empty destructor with at_exit().
// Make sure that instance is created, creating or waiting for it to be
// created if neccessary. Constructs with |ctor| in the space provided by
@@ -81,7 +82,8 @@
class LazyInstance : public LazyInstanceHelper {
public:
explicit LazyInstance(LinkerInitialized x) : LazyInstanceHelper(x) { }
- ~LazyInstance() { }
+ // Declaring a destructor (even if it's empty) will cause MSVC to register a
+ // static initializer to register the empty destructor with at_exit().
Type& Get() {
return *Pointer();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698