mirror of https://github.com/python/cpython
free AST's dict
This commit is contained in:
parent
4775def25d
commit
1767e0274b
|
@ -608,6 +608,12 @@ typedef struct {
|
||||||
PyObject *dict;
|
PyObject *dict;
|
||||||
} AST_object;
|
} AST_object;
|
||||||
|
|
||||||
|
static void
|
||||||
|
ast_dealloc(AST_object *self)
|
||||||
|
{
|
||||||
|
Py_CLEAR(self->dict);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
|
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
|
||||||
{
|
{
|
||||||
|
@ -696,7 +702,7 @@ static PyTypeObject AST_type = {
|
||||||
"_ast.AST",
|
"_ast.AST",
|
||||||
sizeof(AST_object),
|
sizeof(AST_object),
|
||||||
0,
|
0,
|
||||||
0, /* tp_dealloc */
|
(destructor)ast_dealloc, /* tp_dealloc */
|
||||||
0, /* tp_print */
|
0, /* tp_print */
|
||||||
0, /* tp_getattr */
|
0, /* tp_getattr */
|
||||||
0, /* tp_setattr */
|
0, /* tp_setattr */
|
||||||
|
|
|
@ -460,6 +460,12 @@ typedef struct {
|
||||||
PyObject *dict;
|
PyObject *dict;
|
||||||
} AST_object;
|
} AST_object;
|
||||||
|
|
||||||
|
static void
|
||||||
|
ast_dealloc(AST_object *self)
|
||||||
|
{
|
||||||
|
Py_CLEAR(self->dict);
|
||||||
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
|
ast_type_init(PyObject *self, PyObject *args, PyObject *kw)
|
||||||
{
|
{
|
||||||
|
@ -548,7 +554,7 @@ static PyTypeObject AST_type = {
|
||||||
"_ast.AST",
|
"_ast.AST",
|
||||||
sizeof(AST_object),
|
sizeof(AST_object),
|
||||||
0,
|
0,
|
||||||
0, /* tp_dealloc */
|
(destructor)ast_dealloc, /* tp_dealloc */
|
||||||
0, /* tp_print */
|
0, /* tp_print */
|
||||||
0, /* tp_getattr */
|
0, /* tp_getattr */
|
||||||
0, /* tp_setattr */
|
0, /* tp_setattr */
|
||||||
|
|
Loading…
Reference in New Issue