summaryrefslogtreecommitdiff
path: root/Python/Python-ast.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-03-14 21:50:29 -0500
committerBenjamin Peterson <benjamin@python.org>2012-03-14 21:50:29 -0500
commitfeb250da193d7840bcf341f8e1630dd70afde01d (patch)
treecb8bd65295ce8b943fc1fd5be5e85b8acd824f20 /Python/Python-ast.c
parent28a45ea289d325889346e6a09ccc7c93e7d65ea2 (diff)
downloadcpython-feb250da193d7840bcf341f8e1630dd70afde01d.tar.gz
free AST's dict
Diffstat (limited to 'Python/Python-ast.c')
-rw-r--r--Python/Python-ast.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/Python/Python-ast.c b/Python/Python-ast.c
index 1178d74d7f..d9e13e28b0 100644
--- a/Python/Python-ast.c
+++ b/Python/Python-ast.c
@@ -460,6 +460,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)
{
@@ -548,7 +554,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 */