summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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();