comparison Python/Python-ast.c @ 75686:9e7f6ddc0d76

free AST's dict
author Benjamin Peterson <benjamin@python.org>
date Wed, 14 Mar 2012 21:50:29 -0500
parents 6bee4eea1efa
children f4d7ad6c9d6e
comparison
equal deleted inserted replaced
75685:b86b414673c3 75686:9e7f6ddc0d76
458 typedef struct { 458 typedef struct {
459 PyObject_HEAD 459 PyObject_HEAD
460 PyObject *dict; 460 PyObject *dict;
461 } AST_object; 461 } AST_object;
462 462
463 static void
464 ast_dealloc(AST_object *self)
465 {
466 Py_CLEAR(self->dict);
467 }
468
463 static int 469 static int
464 ast_type_init(PyObject *self, PyObject *args, PyObject *kw) 470 ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
465 { 471 {
466 _Py_IDENTIFIER(_fields); 472 _Py_IDENTIFIER(_fields);
467 Py_ssize_t i, numfields = 0; 473 Py_ssize_t i, numfields = 0;
546 static PyTypeObject AST_type = { 552 static PyTypeObject AST_type = {
547 PyVarObject_HEAD_INIT(&PyType_Type, 0) 553 PyVarObject_HEAD_INIT(&PyType_Type, 0)
548 "_ast.AST", 554 "_ast.AST",
549 sizeof(AST_object), 555 sizeof(AST_object),
550 0, 556 0,
551 0, /* tp_dealloc */ 557 (destructor)ast_dealloc, /* tp_dealloc */
552 0, /* tp_print */ 558 0, /* tp_print */
553 0, /* tp_getattr */ 559 0, /* tp_getattr */
554 0, /* tp_setattr */ 560 0, /* tp_setattr */
555 0, /* tp_reserved */ 561 0, /* tp_reserved */
556 0, /* tp_repr */ 562 0, /* tp_repr */