summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2022-07-27 12:37:43 (GMT)
committerGitHub <noreply@github.com>2022-07-27 12:37:43 (GMT)
commit6b01fc7045dfeb27d146983e62759ce81ddf9e30 (patch)
treeb4a1f0f64dcb454e4e9aebcaa7e3fc4f9f29e84a /Modules
parentc72c1d65cbdd14c6984285100bb8f16b982b7b33 (diff)
downloadcpython-6b01fc7045dfeb27d146983e62759ce81ddf9e30.zip
cpython-6b01fc7045dfeb27d146983e62759ce81ddf9e30.tar.gz
cpython-6b01fc7045dfeb27d146983e62759ce81ddf9e30.tar.bz2
GH-95045: gc untrack _lsprof.Profiler before deallocating it (GH-95315)
Automerge-Triggered-By: GH:pablogsal (cherry picked from commit deacf391d7a1b3ab49bffa16088b3500fdb4c435) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_lsprof.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/Modules/_lsprof.c b/Modules/_lsprof.c
index 0e8432f..a0e262b 100644
--- a/Modules/_lsprof.c
+++ b/Modules/_lsprof.c
@@ -747,6 +747,7 @@ profiler_traverse(ProfilerObject *op, visitproc visit, void *arg)
static void
profiler_dealloc(ProfilerObject *op)
{
+ PyObject_GC_UnTrack(op);
if (op->flags & POF_ENABLED) {
PyThreadState *tstate = _PyThreadState_GET();
if (_PyEval_SetProfile(tstate, NULL, NULL) < 0) {