Commit 510f8e04 authored by Guido van Rossum's avatar Guido van Rossum

Fix reference counts of sys_trace and sys_profile

parent b5026e26
/*********************************************************** /***********************************************************
Copyright 1991 by Stichting Mathematisch Centrum, Amsterdam, The Copyright 1991, 1992 by Stichting Mathematisch Centrum, Amsterdam, The
Netherlands. Netherlands.
All Rights Reserved All Rights Reserved
...@@ -101,7 +101,9 @@ sys_settrace(self, args) ...@@ -101,7 +101,9 @@ sys_settrace(self, args)
{ {
if (args == None) if (args == None)
args = NULL; args = NULL;
XINCREF(args); else
INCREF(args);
XDECREF(sys_trace);
sys_trace = args; sys_trace = args;
INCREF(None); INCREF(None);
return None; return None;
...@@ -114,7 +116,9 @@ sys_setprofile(self, args) ...@@ -114,7 +116,9 @@ sys_setprofile(self, args)
{ {
if (args == None) if (args == None)
args = NULL; args = NULL;
XINCREF(args); else
INCREF(args);
XDECREF(sys_profile);
sys_profile = args; sys_profile = args;
INCREF(None); INCREF(None);
return None; return None;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment