summaryrefslogtreecommitdiff
path: root/Python/pythonrun.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1995-10-07 19:14:01 +0000
committerGuido van Rossum <guido@python.org>1995-10-07 19:14:01 +0000
commit0ee68a36107f6e8141647dda6b3ee0a9402902f3 (patch)
tree9f23aea36d60da4c41dd7e725d8385056ff2d152 /Python/pythonrun.c
parent03a7fa2f21d59a04614e54c3d448e548ea0238ab (diff)
downloadcpython-0ee68a36107f6e8141647dda6b3ee0a9402902f3.tar.gz
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 0666c5ac37..9e402a6228 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();