Kill all local variables on function return. This closes a gigantic
leak of memory and file descriptors (thanks for Roj for reporting that!). Alas, the speed goes down by 5%. :-(
This commit is contained in:
parent
a04d47b319
commit
a4240132ec
|
@ -1697,6 +1697,18 @@ eval_code2(co, globals, locals,
|
|||
}
|
||||
}
|
||||
|
||||
/* Kill all local variables */
|
||||
|
||||
{
|
||||
int i;
|
||||
for (i = co->co_nlocals; --i >= 0; ++fastlocals) {
|
||||
if (*fastlocals != NULL) {
|
||||
DECREF(*fastlocals);
|
||||
*fastlocals = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Restore previous frame and release the current one */
|
||||
|
||||
current_frame = f->f_back;
|
||||
|
|
Loading…
Reference in New Issue