Kaydet (Commit) a4240132 authored tarafından Guido van Rossum's avatar Guido van Rossum

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%. :-(
üst a04d47b3
......@@ -1696,6 +1696,18 @@ eval_code2(co, globals, locals,
why = WHY_EXCEPTION;
}
}
/* 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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment