From 7571a0fbcf6fd5d6014008f566f970c84cff7d95 Mon Sep 17 00:00:00 2001 From: Tim Peters Date: Sun, 23 Mar 2003 17:52:28 +0000 Subject: Improved new Py_TRACE_REFS gimmicks. Arranged that all the objects exposed by __builtin__ appear in the list of all objects. I basically peed away two days tracking down a mystery leak in sys.gettotalrefcount() in a ZODB app (== tons of code), because the object leaking the references didn't appear in the sys.getobjects(0) list. The object happened to be False. Now False is in the list, along with other popular & previously missing leak candidates (like None). Alas, we still don't have a choke point covering *all* Python objects, so the list of all objects may still be incomplete. --- Objects/typeobject.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'Objects/typeobject.c') diff --git a/Objects/typeobject.c b/Objects/typeobject.c index 8dfb939b70..4acee5a8c9 100644 --- a/Objects/typeobject.c +++ b/Objects/typeobject.c @@ -3058,10 +3058,7 @@ PyType_Ready(PyTypeObject *type) * to get type objects into the doubly-linked list of all objects. * Still, not all type objects go thru PyType_Ready. */ - if (type->_ob_next == NULL) { - assert(type->_ob_prev == NULL); - _Py_AddToAllObjects((PyObject *)type); - } + _Py_AddToAllObjects((PyObject *)type, 0); #endif /* Initialize tp_base (defaults to BaseObject unless that's us) */ -- cgit v1.2.1