summaryrefslogtreecommitdiffstats
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-10-07 19:14:01 (GMT)
committerGuido van Rossum <guido@python.org>1995-10-07 19:14:01 (GMT)
commit1c45ca310bad0bf387b08765a052be6ebf26d667 (patch)
tree9bd90a6b37dfddca174f9a65e64fcff0b198be4c /Python/pythonrun.c
parentf7f79ac0c8bd741b008278c60f6628119dd27639 (diff)
downloadcpython-1c45ca310bad0bf387b08765a052be6ebf26d667.zip
cpython-1c45ca310bad0bf387b08765a052be6ebf26d667.tar.gz
cpython-1c45ca310bad0bf387b08765a052be6ebf26d667.tar.bz2
keep exitfunc alive while calling it
Diffstat (limited to 'Python/pythonrun.c')
-rw-r--r--Python/pythonrun.c2
1 files changed, 2 insertions, 0 deletions
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 @@ 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();