From f714e791fec2a4474f2a7963b058eaf2de032759 Mon Sep 17 00:00:00 2001 From: Stephen Saunders Date: Thu, 28 Dec 2023 09:24:48 -0500 Subject: [PATCH] Fix memory leak in Optick when ThreadEntry is terminated while still in scope (i.e. exit) --- neo/libs/optick/optick_core.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/neo/libs/optick/optick_core.h b/neo/libs/optick/optick_core.h index ba4e319c..b53d6682 100644 --- a/neo/libs/optick/optick_core.h +++ b/neo/libs/optick/optick_core.h @@ -342,6 +342,9 @@ struct ThreadEntry { *threadTLS = nullptr; } + + // SRS - make sure thread storage is empty before thread entry terminates + storage.Clear(false); } void Activate(Mode::Type mode); void Sort();