summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2003-11-13 22:50:00 (GMT)
committerTim Peters <tim.peters@gmail.com>2003-11-13 22:50:00 (GMT)
commit0bd743cee17ab8a96122ca0cc692419232a3d3bb (patch)
tree8a6339b58769a897f13c02e35dff4aa462d2c926
parentf7f9e9966bbb5f8bf393006720d2e87167e81847 (diff)
downloadcpython-0bd743cee17ab8a96122ca0cc692419232a3d3bb.zip
cpython-0bd743cee17ab8a96122ca0cc692419232a3d3bb.tar.gz
cpython-0bd743cee17ab8a96122ca0cc692419232a3d3bb.tar.bz2
subtype_dealloc(): Simplified overly contorted retracking logic. With
this change, I think subtype_dealloc is actually a smidgen less obscure than it was in 2.3 -- we got rid of a negation in an "if" <wink>.
-rw-r--r--Objects/typeobject.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index 032fa18..e4eadb8 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -690,12 +690,11 @@ subtype_dealloc(PyObject *self)
}
}
- /* Finalize GC if the base doesn't do GC and we do */
- _PyObject_GC_TRACK(self);
- if (!PyType_IS_GC(base))
- _PyObject_GC_UNTRACK(self);
-
- /* Call the base tp_dealloc() */
+ /* Call the base tp_dealloc(); first retrack self if
+ * basedealloc knows about gc.
+ */
+ if (PyType_IS_GC(base))
+ _PyObject_GC_TRACK(self);
assert(basedealloc);
basedealloc(self);