diff options
author | Hai Shi <shihai1992@gmail.com> | 2021-05-31 07:51:19 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-31 07:51:19 (GMT) |
commit | 4b20f2574d412f4c4a5b1ab799d8e71a5dd3b766 (patch) | |
tree | 8dc54773b165ae62156a9bb7bf85aad9502e5ae7 /Modules/xxlimited.c | |
parent | 8ab5b7eecaa1a1a249afbd3bf8358ce2b12e4713 (diff) | |
download | cpython-4b20f2574d412f4c4a5b1ab799d8e71a5dd3b766.zip cpython-4b20f2574d412f4c4a5b1ab799d8e71a5dd3b766.tar.gz cpython-4b20f2574d412f4c4a5b1ab799d8e71a5dd3b766.tar.bz2 |
bpo-42972: Fully implement GC protocol for xxlimited (GH-26451)
Diffstat (limited to 'Modules/xxlimited.c')
-rw-r--r-- | Modules/xxlimited.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Modules/xxlimited.c b/Modules/xxlimited.c index c3d98d3..9bd9a54 100644 --- a/Modules/xxlimited.c +++ b/Modules/xxlimited.c @@ -106,6 +106,13 @@ Xxo_traverse(XxoObject *self, visitproc visit, void *arg) return 0; } +static int +Xxo_clear(XxoObject *self) +{ + Py_CLEAR(self->x_attr); + return 0; +} + static void Xxo_finalize(XxoObject *self) { @@ -214,6 +221,7 @@ PyDoc_STRVAR(Xxo_doc, static PyType_Slot Xxo_Type_slots[] = { {Py_tp_doc, (char *)Xxo_doc}, {Py_tp_traverse, Xxo_traverse}, + {Py_tp_clear, Xxo_clear}, {Py_tp_finalize, Xxo_finalize}, {Py_tp_dealloc, Xxo_dealloc}, {Py_tp_getattro, Xxo_getattro}, |