summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--base/singleton.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/base/singleton.h b/base/singleton.h
index c6a1685..00cd448 100644
--- a/base/singleton.h
+++ b/base/singleton.h
@@ -31,6 +31,16 @@ struct DefaultSingletonTraits {
static const bool kRegisterAtExit = true;
};
+
+// Alternate traits for use with the Singleton<Type>. Identical to
+// DefaultSingletonTraits except that the Singleton will not be cleaned up
+// at exit.
+template<typename Type>
+struct LeakySingletonTraits : public DefaultSingletonTraits<Type> {
+ static const bool kRegisterAtExit = false;
+};
+
+
// The Singleton<Type, Traits, DifferentiatingType> class manages a single
// instance of Type which will be created on first use and will be destroyed at
// normal process exit). The Trait::Delete function will not be called on