Summary:
This reverts commit
3cf88fb680b4b9c47189d1e12699e2c24c7ac38b. It
was timing out our tests. probably static (de)initialization order fiasco related.
Test Plan: watch contbuild, git bisect
Reviewed By: afrind@fb.com
Subscribers: doug, njormrod
FB internal diff:
D1593016
}
SingletonVault* SingletonVault::singleton() {
- static SingletonVault* vault = new SingletonVault();
- return vault;
+ static SingletonVault vault;
+ return &vault;
}
-
-namespace {
-
-class SingletonVaultDestructor {
- public:
- ~SingletonVaultDestructor() {
- SingletonVault::singleton()->destroyInstances();
- }
-};
-
-SingletonVaultDestructor singletonVaultDestructor;
-
-}
-
}
enum class Type { Strict, Relaxed };
explicit SingletonVault(Type type = Type::Relaxed) : type_(type) {}
-
- // Destructor is only called by unit tests to check destroyInstances.
~SingletonVault();
typedef std::function<void(void*)> TeardownFunc;