bpo-31095: fix potential crash during GC (GH-2974)
This commit is contained in:
@@ -520,6 +520,8 @@ typedef struct {
|
||||
static void
|
||||
ast_dealloc(AST_object *self)
|
||||
{
|
||||
/* bpo-31095: UnTrack is needed before calling any callbacks */
|
||||
PyObject_GC_UnTrack(self);
|
||||
Py_CLEAR(self->dict);
|
||||
Py_TYPE(self)->tp_free(self);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user