commit | 1c45ca310bad0bf387b08765a052be6ebf26d667 | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Sat Oct 07 19:14:01 1995 +0000 |
committer | Guido van Rossum <guido@python.org> | Sat Oct 07 19:14:01 1995 +0000 |
tree | 9bd90a6b37dfddca174f9a65e64fcff0b198be4c | |
parent | f7f79ac0c8bd741b008278c60f6628119dd27639 [diff] [blame] |
keep exitfunc alive while calling it
diff --git a/Python/pythonrun.c b/Python/pythonrun.c index 0666c5a..9e402a6 100644 --- a/Python/pythonrun.c +++ b/Python/pythonrun.c
@@ -605,12 +605,14 @@ 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();