From 18e0e7f2e7be8b354cffb45aec2ac3ac56504685 Mon Sep 17 00:00:00 2001 From: Robert Beckebans Date: Wed, 1 Mar 2023 16:13:48 +0100 Subject: [PATCH] Fixed crash of RBDoom after stopping an Optick capture --- neo/libs/optick/optick_core.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/neo/libs/optick/optick_core.h b/neo/libs/optick/optick_core.h index 348e30eb..9066433d 100644 --- a/neo/libs/optick/optick_core.h +++ b/neo/libs/optick/optick_core.h @@ -333,6 +333,15 @@ struct ThreadEntry bool isAlive; ThreadEntry(const ThreadDescription& desc, EventStorage** tls) : description(desc), threadTLS(tls), isAlive(true) {} + // RB: see Fix for crash on stop capture #1 + // https://github.com/ulricheck/optick/pull/1/commits/1e5e1919816a64f235caa0f4b0bf20495225b1fa + ~ThreadEntry() + { + if((*threadTLS)!=nullptr) + { + *threadTLS = nullptr; + } + } void Activate(Mode::Type mode); void Sort(); };