mirror of
https://github.com/XRPLF/rippled.git
synced 2025-12-06 09:17:57 +00:00
New SharedSingleton, resolves destruction of objects with static storage duration.
This commit is contained in:
@@ -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 ()
|
||||
|
||||
Reference in New Issue
Block a user