mirror of
https://github.com/python/cpython.git
synced 2026-10-28 18:35:21 +08:00
[3.14] gh-159739: Break reference cycles involving property objects (GH-159978) (#160015)
(cherry picked from commit 4101d59902)
Co-authored-by: Jelle Zijlstra <jelle@openai.com>
This commit is contained in:
1 parent
3d2f1b2d7a
commit
06a11dffeb
2 files changed
+6
No files matched your search
@@ -0,0 +1,2 @@
|
||||
Allow the garbage collector to break reference cycles involving property
|
||||
accessors or names.
|
||||
@@ -1988,7 +1988,11 @@ static int
|
||||
property_clear(PyObject *self)
|
||||
{
|
||||
propertyobject *pp = (propertyobject *)self;
|
||||
Py_CLEAR(pp->prop_get);
|
||||
Py_CLEAR(pp->prop_set);
|
||||
Py_CLEAR(pp->prop_del);
|
||||
Py_CLEAR(pp->prop_doc);
|
||||
Py_CLEAR(pp->prop_name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user