summaryrefslogtreecommitdiffstats
path: root/Python/Python-ast.c
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2012-03-15 02:50:29 (GMT)
committerBenjamin Peterson <benjamin@python.org>2012-03-15 02:50:29 (GMT)
commit1767e0274bf68a01cf8ce48905f1e59532013928 (patch)
treec780cff07e6ec961b23a46bf0954c4916f4a32b2 /Python/Python-ast.c
parent4775def25d5f7428d83c3ea15055f27178f3daf3 (diff)
downloadcpython-1767e0274bf68a01cf8ce48905f1e59532013928.zip
cpython-1767e0274bf68a01cf8ce48905f1e59532013928.tar.gz
cpython-1767e0274bf68a01cf8ce48905f1e59532013928.tar.bz2
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 1178d74..d9e13e2 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 */