mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
gh-93728: fix memory leak in deepfrozen code objects (GH-93729)
This commit is contained in:
parent
3473817106
commit
8f728e5baa
1 changed files with 1 additions and 0 deletions
|
@ -2092,6 +2092,7 @@ _PyStaticCode_Dealloc(PyCodeObject *co)
|
||||||
deopt_code(_PyCode_CODE(co), Py_SIZE(co));
|
deopt_code(_PyCode_CODE(co), Py_SIZE(co));
|
||||||
co->co_warmup = QUICKENING_INITIAL_WARMUP_VALUE;
|
co->co_warmup = QUICKENING_INITIAL_WARMUP_VALUE;
|
||||||
PyMem_Free(co->co_extra);
|
PyMem_Free(co->co_extra);
|
||||||
|
Py_CLEAR(co->_co_code);
|
||||||
co->co_extra = NULL;
|
co->co_extra = NULL;
|
||||||
if (co->co_weakreflist != NULL) {
|
if (co->co_weakreflist != NULL) {
|
||||||
PyObject_ClearWeakRefs((PyObject *)co);
|
PyObject_ClearWeakRefs((PyObject *)co);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue