[llvm] [Support] Fix memory leak in `Timer.cpp` on shutdown (PR #159983)
Alexandre Ganea via llvm-commits
llvm-commits at lists.llvm.org
Sun Sep 21 10:10:58 PDT 2025
================
@@ -305,14 +306,24 @@ TimerGroup::~TimerGroup() {
PrintQueuedTimers(*OutStream);
}
+ auto unlink = [&]() {
+ *Prev = Next;
+ if (Next)
+ Next->Prev = Prev;
+ };
+
+ // If the managed instance is already dead, it means we're in the CRT
----------------
aganea wrote:
I will clarify the comment.
https://github.com/llvm/llvm-project/pull/159983
More information about the llvm-commits
mailing list