14using CleanupList = std::list<SingletonDeleterFn>;
16CleanupList &cleanupList() {
17 static CleanupList cleanup;
25void cleanupSingletons() {
26 auto &deleters = cleanupList();
27 for (
auto &deleter : deleters) {
39 auto &deleters = cleanupList();
40 if (deleters.empty()) {
41 atexit(&cleanupSingletons);
43 deleters.push_front(func);
std::function< void()> SingletonDeleterFn
Type of deleter function.
MANTID_KERNEL_DLL void deleteOnExit(const SingletonDeleterFn &func)
Register the given deleter function to be called at exit.