Skip to content

Commit f3ec095

Browse files
committed
Call _PyTraceMalloc_Fini() after finalize_interp_clear()
1 parent 4172b91 commit f3ec095

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Python/pylifecycle.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2113,7 +2113,7 @@ _Py_Finalize(_PyRuntimeState *runtime)
21132113

21142114
/* Disable tracemalloc after all Python objects have been destroyed,
21152115
so it is possible to use tracemalloc in objects destructor. */
2116-
_PyTraceMalloc_Fini();
2116+
_PyTraceMalloc_Stop();
21172117

21182118
/* Finalize any remaining import state */
21192119
// XXX Move these up to where finalize_modules() is currently.
@@ -2166,6 +2166,8 @@ _Py_Finalize(_PyRuntimeState *runtime)
21662166

21672167
finalize_interp_clear(tstate);
21682168

2169+
_PyTraceMalloc_Fini();
2170+
21692171
#ifdef Py_TRACE_REFS
21702172
/* Display addresses (& refcnts) of all objects still alive.
21712173
* An address can be used to find the repr of the object, printed

0 commit comments

Comments
 (0)