diff options
author | Raymond Hettinger <python@rcn.com> | 2015-05-13 18:12:33 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2015-05-13 18:12:33 (GMT) |
commit | d4be6914943fbc829bcbb62c3aa59f84c917c522 (patch) | |
tree | dd7934153a76aa05e0973a1a421677b16099e9e5 /Objects | |
parent | 29f88c22e69a33dcf6d66f1d141c111188c5d212 (diff) | |
download | cpython-d4be6914943fbc829bcbb62c3aa59f84c917c522.zip cpython-d4be6914943fbc829bcbb62c3aa59f84c917c522.tar.gz cpython-d4be6914943fbc829bcbb62c3aa59f84c917c522.tar.bz2 |
Issue #24064: Help property() support GC
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/descrobject.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/Objects/descrobject.c b/Objects/descrobject.c index 906f76d..24b24e7 100644 --- a/Objects/descrobject.c +++ b/Objects/descrobject.c @@ -1592,6 +1592,14 @@ property_traverse(PyObject *self, visitproc visit, void *arg) return 0; } +static int +property_clear(PyObject *self) +{ + propertyobject *pp = (propertyobject *)self; + Py_CLEAR(pp->prop_doc); + return 0; +} + PyTypeObject PyProperty_Type = { PyVarObject_HEAD_INIT(&PyType_Type, 0) "property", /* tp_name */ @@ -1617,7 +1625,7 @@ PyTypeObject PyProperty_Type = { Py_TPFLAGS_BASETYPE, /* tp_flags */ property_doc, /* tp_doc */ property_traverse, /* tp_traverse */ - 0, /* tp_clear */ + (inquiry)property_clear, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ |