From 129b80ef0fc19ec277bd99183ec948dd37f9d253 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 6 Dec 2019 00:42:42 +0100 Subject: [PATCH] Free source location, if zone is not active. --- client/TracyProfiler.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/TracyProfiler.cpp b/client/TracyProfiler.cpp index a0902dd5..3e593a34 100644 --- a/client/TracyProfiler.cpp +++ b/client/TracyProfiler.cpp @@ -2775,7 +2775,11 @@ TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_alloc( uint64_t srcloc, int act #else ctx.active = active; #endif - if( !ctx.active ) return ctx; + if( !ctx.active ) + { + tracy::tracy_free( (void*)srcloc ); + return ctx; + } const auto id = tracy::GetProfiler().GetNextZoneId(); ctx.id = id; @@ -2811,7 +2815,11 @@ TRACY_API TracyCZoneCtx ___tracy_emit_zone_begin_alloc_callstack( uint64_t srclo #else ctx.active = active; #endif - if( !ctx.active ) return ctx; + if( !ctx.active ) + { + tracy::tracy_free( (void*)srcloc ); + return ctx; + } const auto id = tracy::GetProfiler().GetNextZoneId(); ctx.id = id;