From: Jeremy Hylton Date: Thu, 1 Mar 2001 06:06:37 +0000 (+0000) Subject: Visit the closure during traversal and XDECREF it on during deallocation. X-Git-Tag: v2.1b1~77 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a52e8fe49a625d13d89967bc17adeb71520bf3d0;p=python Visit the closure during traversal and XDECREF it on during deallocation. --- diff --git a/Objects/funcobject.c b/Objects/funcobject.c index 0282242f4d..8871e0ac1f 100644 --- a/Objects/funcobject.c +++ b/Objects/funcobject.c @@ -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; }