]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix refleak with nested classes. Fix originally by Amaury in r62015.
authorNeal Norwitz <nnorwitz@gmail.com>
Tue, 1 Apr 2008 08:08:09 +0000 (08:08 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Tue, 1 Apr 2008 08:08:09 +0000 (08:08 +0000)
Python/compile.c

index 9ce8ac334ffcc24108deaf4c18e0eca419611ae7..94a27154431968b4bce34c309d1823a6774a0d4b 100644 (file)
@@ -1551,6 +1551,7 @@ compiler_class(struct compiler *c, stmt_ty s)
        {
                /* use the class name for name mangling */
                Py_INCREF(s->v.ClassDef.name);
+               Py_XDECREF(c->u->u_private);
                c->u->u_private = s->v.ClassDef.name;
                /* force it to have one mandatory argument */
                c->u->u_argcount = 1;