summaryrefslogtreecommitdiff
path: root/Python/sysmodule.c
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1992-04-05 14:17:55 +0000
committerGuido van Rossum <guido@python.org>1992-04-05 14:17:55 +0000
commit510f8e049fa32f7978a169158f4fb1bdd88a3428 (patch)
treef3b92c53049ed2e823ddd569697d6546add980fe /Python/sysmodule.c
parentb5026e26edc5eef046e74d7dd608fa32ee4012af (diff)
downloadcpython-510f8e049fa32f7978a169158f4fb1bdd88a3428.tar.gz
Fix reference counts of sys_trace and sys_profile
Diffstat (limited to 'Python/sysmodule.c')
-rw-r--r--Python/sysmodule.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/Python/sysmodule.c b/Python/sysmodule.c
index 8b99e2701a..a12595caa8 100644
--- a/Python/sysmodule.c
+++ b/Python/sysmodule.c
@@ -1,5 +1,5 @@
/***********************************************************
-Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The
+Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
Netherlands.
All Rights Reserved
@@ -101,7 +101,9 @@ sys_settrace(self, args)
{
if (args == None)
args = NULL;
- XINCREF(args);
+ else
+ INCREF(args);
+ XDECREF(sys_trace);
sys_trace = args;
INCREF(None);
return None;
@@ -114,7 +116,9 @@ sys_setprofile(self, args)
{
if (args == None)
args = NULL;
- XINCREF(args);
+ else
+ INCREF(args);
+ XDECREF(sys_profile);
sys_profile = args;
INCREF(None);
return None;