Commit 05ce9b0e authored by Jeremy Hylton's avatar Jeremy Hylton

Visit the closure during traversal and XDECREF it on during deallocation.

parent f3b3f987
......@@ -252,6 +252,7 @@ func_dealloc(PyFunctionObject *op)
Py_XDECREF(op->func_defaults);
Py_XDECREF(op->func_doc);
Py_XDECREF(op->func_dict);
Py_XDECREF(op->func_closure);
op = (PyFunctionObject *) PyObject_AS_GC(op);
PyObject_DEL(op);
}
......@@ -303,6 +304,11 @@ func_traverse(PyFunctionObject *f, visitproc visit, void *arg)
if (err)
return err;
}
if (f->func_closure) {
err = visit(f->func_closure, arg);
if (err)
return err;
}
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment