[ThreadPool] delete debug global variable if not needed
authorLuboš Luňák <l.lunak@centrum.cz>
Wed, 4 May 2022 06:11:49 +0000 (08:11 +0200)
committerLuboš Luňák <l.lunak@centrum.cz>
Wed, 4 May 2022 06:12:45 +0000 (08:12 +0200)
https://lab.llvm.org/buildbot/#/builders/5/builds/23099

llvm/lib/Support/ThreadPool.cpp

index bb566eb..31461e3 100644 (file)
@@ -100,6 +100,10 @@ void ThreadPool::processTasks(ThreadPoolTaskGroup *WaitingForGroup) {
 
 #ifndef NDEBUG
     CurrentThreadTaskGroups->pop_back();
+    if (CurrentThreadTaskGroups->empty()) {
+      delete CurrentThreadTaskGroups;
+      CurrentThreadTaskGroups = nullptr;
+    }
 #endif
 
     bool Notify;