]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix reference counts of sys_trace and sys_profile
authorGuido van Rossum <guido@python.org>
Sun, 5 Apr 1992 14:17:55 +0000 (14:17 +0000)
committerGuido van Rossum <guido@python.org>
Sun, 5 Apr 1992 14:17:55 +0000 (14:17 +0000)
Python/sysmodule.c

index 8b99e2701a33002dcbc2ece7ad107c164fac08d0..a12595caa8f54c6088c247667b478b8b5b91b299 100644 (file)
@@ -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;