summaryrefslogtreecommitdiffstats
path: root/Parser/asdl_c.py
diff options
context:
space:
mode:
Diffstat (limited to 'Parser/asdl_c.py')
-rwxr-xr-xParser/asdl_c.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/Parser/asdl_c.py b/Parser/asdl_c.py
index 0be6c7f..81a3d6a 100755
--- a/Parser/asdl_c.py
+++ b/Parser/asdl_c.py
@@ -608,6 +608,12 @@ typedef struct {
PyObject *dict;
} AST_object;
+static void
+ast_dealloc(AST_object *self)
+{
+ Py_CLEAR(self->dict);
+}
+
static int
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
{
@@ -696,7 +702,7 @@ static PyTypeObject AST_type = {
"_ast.AST",
sizeof(AST_object),
0,
- 0, /* tp_dealloc */
+ (destructor)ast_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */