mirror of
https://github.com/python/cpython.git
synced 2025-11-24 20:30:18 +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
|
|
@ -13,6 +13,7 @@
|
|||
#include "pycore_pyerrors.h" // _PyErr_FormatFromCause()
|
||||
#include "pycore_pystate.h" // _PyInterpreterState_GET()
|
||||
#include "pycore_unicodeobject.h" // _PyUnicode_EqualToASCIIString()
|
||||
#include "pycore_weakref.h" // FT_CLEAR_WEAKREFS()
|
||||
|
||||
#include "osdefs.h" // MAXPATHLEN
|
||||
|
||||
|
|
@ -826,8 +827,7 @@ module_dealloc(PyObject *self)
|
|||
if (verbose && m->md_name) {
|
||||
PySys_FormatStderr("# destroy %U\n", m->md_name);
|
||||
}
|
||||
if (m->md_weaklist != NULL)
|
||||
PyObject_ClearWeakRefs((PyObject *) m);
|
||||
FT_CLEAR_WEAKREFS(self, m->md_weaklist);
|
||||
|
||||
/* bpo-39824: Don't call m_free() if m_size > 0 and md_state=NULL */
|
||||
if (m->md_def && m->md_def->m_free
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue