[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:
Miss Islington (bot)andJelle Zijlstra authored and GitHub committed 2026-10-21 11:49:03 -07:00
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.
+4
View File
@@ -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;
}