diff options
| author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-03-01 06:06:37 +0000 |
|---|---|---|
| committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-03-01 06:06:37 +0000 |
| commit | a52e8fe49a625d13d89967bc17adeb71520bf3d0 (patch) | |
| tree | 7d17cebb6b865824c6bfbf4552c46c12281aa3da /Objects/funcobject.c | |
| parent | baee0d42c91801748790e1c5097428f48a424f44 (diff) | |
| download | cpython-git-a52e8fe49a625d13d89967bc17adeb71520bf3d0.tar.gz | |
Visit the closure during traversal and XDECREF it on during deallocation.
Diffstat (limited to 'Objects/funcobject.c')
| -rw-r--r-- | Objects/funcobject.c | 6 |
1 files changed, 6 insertions, 0 deletions
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; } |
