mirror of
https://github.com/python/cpython.git
synced 2025-10-05 14:41:07 +00:00
bpo-31095: fix potential crash during GC (GH-3195)
(cherry picked from commit a6296d34a4
)
This commit is contained in:
parent
7d8282d25d
commit
2eea952b1b
14 changed files with 60 additions and 13 deletions
|
@ -1605,6 +1605,8 @@ typedef struct {
|
|||
static void
|
||||
unpackiter_dealloc(unpackiterobject *self)
|
||||
{
|
||||
/* bpo-31095: UnTrack is needed before calling any callbacks */
|
||||
PyObject_GC_UnTrack(self);
|
||||
Py_XDECREF(self->so);
|
||||
PyBuffer_Release(&self->buf);
|
||||
PyObject_GC_Del(self);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue