Commit 0ee68a36 authored by Guido van Rossum's avatar Guido van Rossum

keep exitfunc alive while calling it

parent 03a7fa2f
......@@ -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();
......
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