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
|
@ -5,6 +5,7 @@
|
|||
#include "pycore_moduleobject.h" // _PyModule_GetState()
|
||||
#include "pycore_pyatomic_ft_wrappers.h"
|
||||
#include "pycore_typeobject.h" // _PyType_GetModuleState()
|
||||
#include "pycore_weakref.h" // FT_CLEAR_WEAKREFS()
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
|
@ -1532,9 +1533,7 @@ deque_dealloc(PyObject *self)
|
|||
Py_ssize_t i;
|
||||
|
||||
PyObject_GC_UnTrack(deque);
|
||||
if (deque->weakreflist != NULL) {
|
||||
PyObject_ClearWeakRefs(self);
|
||||
}
|
||||
FT_CLEAR_WEAKREFS(self, deque->weakreflist);
|
||||
if (deque->leftblock != NULL) {
|
||||
(void)deque_clear(self);
|
||||
assert(deque->leftblock != NULL);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue