mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
bpo-31787: Prevent refleaks when calling __init__() more than once (GH-3995)
This commit is contained in:
parent
aec7532ed3
commit
d019bc8319
13 changed files with 105 additions and 19 deletions
|
|
@ -1490,10 +1490,10 @@ property_init_impl(propertyobject *self, PyObject *fget, PyObject *fset,
|
|||
Py_XINCREF(fdel);
|
||||
Py_XINCREF(doc);
|
||||
|
||||
self->prop_get = fget;
|
||||
self->prop_set = fset;
|
||||
self->prop_del = fdel;
|
||||
self->prop_doc = doc;
|
||||
Py_XSETREF(self->prop_get, fget);
|
||||
Py_XSETREF(self->prop_set, fset);
|
||||
Py_XSETREF(self->prop_del, fdel);
|
||||
Py_XSETREF(self->prop_doc, doc);
|
||||
self->getter_doc = 0;
|
||||
|
||||
/* if no docstring given and the getter has one, use that one */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue