mirror of
https://github.com/python/cpython.git
synced 2026-01-04 14:32:21 +00:00
[3.13] gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614) (#136126)
gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614)
(cherry picked from commit b1056c2a44)
Co-authored-by: Xuanteng Huang <44627253+xuantengh@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
This commit is contained in:
parent
1e3466a1ae
commit
e3a277c8d8
31 changed files with 75 additions and 73 deletions
|
|
@ -13,6 +13,7 @@
|
|||
#include "pycore_ceval.h" // _PyEval_GetBuiltin()
|
||||
#include "pycore_modsupport.h" // _PyArg_NoKeywords()
|
||||
#include "pycore_moduleobject.h" // _PyModule_GetState()
|
||||
#include "pycore_weakref.h" // FT_CLEAR_WEAKREFS()
|
||||
|
||||
#include <stddef.h> // offsetof()
|
||||
#include <stdbool.h>
|
||||
|
|
@ -708,8 +709,7 @@ array_dealloc(arrayobject *op)
|
|||
PyTypeObject *tp = Py_TYPE(op);
|
||||
PyObject_GC_UnTrack(op);
|
||||
|
||||
if (op->weakreflist != NULL)
|
||||
PyObject_ClearWeakRefs((PyObject *) op);
|
||||
FT_CLEAR_WEAKREFS((PyObject *) op, op->weakreflist);
|
||||
if (op->ob_item != NULL)
|
||||
PyMem_Free(op->ob_item);
|
||||
tp->tp_free(op);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue