Fix refleak with nested classes. Fix originally by Amaury in r62015.

This commit is contained in:
Neal Norwitz 2008-04-01 08:08:09 +00:00
parent f7276c9b0e
commit 36e6310e39

View file

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