diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-03-13 01:58:22 +0000 |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2001-03-13 01:58:22 +0000 |
commit | 836bdd00848d906d1d7564b3c2bce1f282097a56 (patch) | |
tree | af4045dbc3a7a1650a08ea65d8273b0a94123718 /Objects/cellobject.c | |
parent | 0f0ba95cd976c1e4003508f41c1601cffb86c774 (diff) | |
download | cpython-836bdd00848d906d1d7564b3c2bce1f282097a56.tar.gz |
Variety of small INC/DECREF patches that fix reported memory leaks
with free variables. Thanks to Martin v. Loewis for finding two of
the problems. This fixes SF buf 405583.
There is also a C API change: PyFrame_New() is reverting to its
pre-2.1 signature. The change introduced by nested scopes was a
mistake. XXX Is this okay between beta releases?
cell_clear(), the GC helper, must decref its reference to break
cycles.
frame_dealloc() must dealloc all cell vars and free vars in addition
to locals.
eval_code2() setup code must INCREF cells it copies out of the
closure.
The STORE_DEREF opcode implementation must DECREF the object it passes
to PyCell_Set().
Diffstat (limited to 'Objects/cellobject.c')
-rw-r--r-- | Objects/cellobject.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Objects/cellobject.c b/Objects/cellobject.c index d9ecfd76f0..66fc8d1d52 100644 --- a/Objects/cellobject.c +++ b/Objects/cellobject.c @@ -83,6 +83,7 @@ cell_traverse(PyCellObject *op, visitproc visit, void *arg) static int cell_clear(PyCellObject *op) { + Py_XDECREF(op->ob_ref); op->ob_ref = NULL; return 0; } |