mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
[3.12] gh-108295: Fix crashes with TypeVar weakrefs (GH-108517) (#108527)
gh-108295: Fix crashes with TypeVar weakrefs (GH-108517)
(cherry picked from commit 482fad7f01
)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This commit is contained in:
parent
3e20303717
commit
09877a15d5
3 changed files with 14 additions and 0 deletions
|
@ -201,6 +201,7 @@ typevar_dealloc(PyObject *self)
|
|||
Py_XDECREF(tv->constraints);
|
||||
Py_XDECREF(tv->evaluate_constraints);
|
||||
_PyObject_ClearManagedDict(self);
|
||||
PyObject_ClearWeakRefs(self);
|
||||
|
||||
Py_TYPE(self)->tp_free(self);
|
||||
Py_DECREF(tp);
|
||||
|
@ -743,6 +744,7 @@ paramspec_dealloc(PyObject *self)
|
|||
Py_DECREF(ps->name);
|
||||
Py_XDECREF(ps->bound);
|
||||
_PyObject_ClearManagedDict(self);
|
||||
PyObject_ClearWeakRefs(self);
|
||||
|
||||
Py_TYPE(self)->tp_free(self);
|
||||
Py_DECREF(tp);
|
||||
|
@ -1022,6 +1024,7 @@ typevartuple_dealloc(PyObject *self)
|
|||
|
||||
Py_DECREF(tvt->name);
|
||||
_PyObject_ClearManagedDict(self);
|
||||
PyObject_ClearWeakRefs(self);
|
||||
|
||||
Py_TYPE(self)->tp_free(self);
|
||||
Py_DECREF(tp);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue