mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +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
|
@ -4,6 +4,7 @@
|
|||
|
||||
#include "blob.h"
|
||||
#include "util.h"
|
||||
#include "pycore_weakref.h" // FT_CLEAR_WEAKREFS()
|
||||
|
||||
#define clinic_state() (pysqlite_get_state_by_type(Py_TYPE(self)))
|
||||
#include "clinic/blob.c.h"
|
||||
|
@ -51,9 +52,7 @@ blob_dealloc(pysqlite_Blob *self)
|
|||
|
||||
close_blob(self);
|
||||
|
||||
if (self->in_weakreflist != NULL) {
|
||||
PyObject_ClearWeakRefs((PyObject*)self);
|
||||
}
|
||||
FT_CLEAR_WEAKREFS((PyObject*)self, self->in_weakreflist);
|
||||
tp->tp_clear((PyObject *)self);
|
||||
tp->tp_free(self);
|
||||
Py_DECREF(tp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue