New SharedSingleton, resolves destruction of objects with static storage duration.

This commit is contained in:
Vinnie Falco
2013-09-12 04:35:13 -07:00
parent 41eb8a1e29
commit 55447b05ac
17 changed files with 150 additions and 229 deletions

View File

@@ -24,20 +24,15 @@
// We need to make a shared singleton or else there are
// issues with the leak detector and order of detruction.
//
class NonexistentHolder : public SharedSingleton <NonexistentHolder>
class NonexistentHolder
{
public:
NonexistentHolder ()
: SharedSingleton <NonexistentHolder> (SingletonLifetime::persistAfterCreation)
static NonexistentHolder* getInstance()
{
return SharedSingleton <NonexistentHolder>::getInstance();
}
static NonexistentHolder* createInstance ()
{
return new NonexistentHolder;
}
File const file;
File file;
};
File const& File::nonexistent ()