gh-144068: fix JIT tracer memory leak when daemon thread exits (GH-144077)

This commit is contained in:
Hai Zhu 2026-01-24 17:43:01 +08:00 committed by GitHub
parent 6f579147e3
commit 29840247ff
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 28 additions and 0 deletions

View file

@ -1843,6 +1843,10 @@ PyThreadState_Clear(PyThreadState *tstate)
_PyThreadState_ClearMimallocHeaps(tstate);
#ifdef _Py_TIER2
_PyJit_TracerFree((_PyThreadStateImpl *)tstate);
#endif
tstate->_status.cleared = 1;
// XXX Call _PyThreadStateSwap(runtime, NULL) here if "current".