MCPcopy Index your code
hub / github.com/Audio4Linux/JDSP4Linux / ~singleton

Method ~singleton

3rdparty/asyncplusplus/src/singleton.h:48–52  ·  view source on GitHub ↗

Use a destructor instead of atexit() because the latter does not work properly when the singleton is in a library that is unloaded.

Source from the content-addressed store, hash-verified

46 // Use a destructor instead of atexit() because the latter does not work
47 // properly when the singleton is in a library that is unloaded.
48 ~singleton()
49 {
50 if (init_flag.load(std::memory_order_acquire))
51 reinterpret_cast<T*>(&storage)->~T();
52 }
53
54public:
55 static T& get_instance()

Callers

nothing calls this directly

Calls 1

loadMethod · 0.45

Tested by

no test coverage detected