keep exitfunc alive while calling it

This commit is contained in:
Guido van Rossum 1995-10-07 19:14:01 +00:00
parent f7f79ac0c8
commit 1c45ca310b
1 changed files with 2 additions and 0 deletions

View File

@ -605,12 +605,14 @@ cleanup()
if (exitfunc) {
object *res;
INCREF(exitfunc);
sysset("exitfunc", (object *)NULL);
res = call_object(exitfunc, (object *)NULL);
if (res == NULL) {
fprintf(stderr, "Error in sys.exitfunc:\n");
print_error();
}
DECREF(exitfunc);
}
flushline();