From 14e2553b8e8550a0365289e8530d2d9a06167225 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Fri, 24 Jan 2025 11:44:13 +0100 Subject: [PATCH] gh-128679: Clear the ref trace in _PyTraceMalloc_Stop() _PyTraceMalloc_Stop() now calls PyRefTracer_SetTracer(NULL, NULL). --- Python/tracemalloc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Python/tracemalloc.c b/Python/tracemalloc.c index 89bc7629933921..99ba7876acced7 100644 --- a/Python/tracemalloc.c +++ b/Python/tracemalloc.c @@ -986,6 +986,8 @@ _PyTraceMalloc_Stop(void) raw_free(tracemalloc_traceback); tracemalloc_traceback = NULL; + (void)PyRefTracer_SetTracer(NULL, NULL); + done: TABLES_UNLOCK(); }