Browse Source

Check for re-init in destructor

Paul-Louis Ageneau 5 years ago
parent
commit
f5ff042d62
1 changed files with 2 additions and 0 deletions
  1. 2 0
      src/init.cpp

+ 2 - 0
src/init.cpp

@@ -133,6 +133,8 @@ Init::~Init() {
 	std::thread t([]() {
 	std::thread t([]() {
 		// We need to lock Mutex ourselves
 		// We need to lock Mutex ourselves
 		std::unique_lock lock(Mutex);
 		std::unique_lock lock(Mutex);
+		if (Global)
+			return;
 		if (std::exchange(Initialized, false))
 		if (std::exchange(Initialized, false))
 			doCleanup();
 			doCleanup();
 	});
 	});