diff options
author | Guido van Rossum <guido@python.org> | 1995-10-07 19:14:01 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1995-10-07 19:14:01 (GMT) |
commit | 1c45ca310bad0bf387b08765a052be6ebf26d667 (patch) | |
tree | 9bd90a6b37dfddca174f9a65e64fcff0b198be4c | |
parent | f7f79ac0c8bd741b008278c60f6628119dd27639 (diff) | |
download | cpython-1c45ca310bad0bf387b08765a052be6ebf26d667.zip cpython-1c45ca310bad0bf387b08765a052be6ebf26d667.tar.gz cpython-1c45ca310bad0bf387b08765a052be6ebf26d667.tar.bz2 |
keep exitfunc alive while calling it
-rw-r--r-- | Python/pythonrun.c | 2 |
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(); |