bpo-46417: remove_subclass() clears tp_subclasses (GH-30793)
The remove_subclass() function now deletes the dictionary when removing the last subclass (if the dictionary becomes empty) to save memory: set PyTypeObject.tp_subclasses to NULL. remove_subclass() is called when a type is deallocated. _PyType_GetSubclasses() no longer holds a reference to tp_subclasses: its loop cannot modify tp_subclasses.
V
Victor Stinner committed
2d03b73cc9c0dada3243eab1373a46dbd98d24a0
Parent: f1c6ae3
Committed by GitHub <noreply@github.com>
on 1/22/2022, 3:53:30 PM