mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-135607: remove null checking of weakref list in dealloc of extension modules and objects (#135614)
Co-authored-by: Kumar Aditya <kumaraditya@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
parent
0533c1faf2
commit
b1056c2a44
32 changed files with 77 additions and 83 deletions
|
@ -17,6 +17,7 @@
|
|||
|
||||
#include "Python.h"
|
||||
#include "pycore_pyhash.h" // _Py_HashSecret
|
||||
#include "pycore_weakref.h" // FT_CLEAR_WEAKREFS()
|
||||
|
||||
#include <stddef.h> // offsetof()
|
||||
#include "expat.h"
|
||||
|
@ -690,8 +691,7 @@ element_dealloc(PyObject *op)
|
|||
/* bpo-31095: UnTrack is needed before calling any callbacks */
|
||||
PyObject_GC_UnTrack(self);
|
||||
|
||||
if (self->weakreflist != NULL)
|
||||
PyObject_ClearWeakRefs(op);
|
||||
FT_CLEAR_WEAKREFS(op, self->weakreflist);
|
||||
|
||||
/* element_gc_clear clears all references and deallocates extra
|
||||
*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue