summaryrefslogtreecommitdiff
path: root/Objects/classobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/classobject.c')
-rw-r--r--Objects/classobject.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/Objects/classobject.c b/Objects/classobject.c
index 17a5646781..bdbcd6a1b3 100644
--- a/Objects/classobject.c
+++ b/Objects/classobject.c
@@ -670,13 +670,14 @@ instance_dealloc(register PyInstanceObject *inst)
_Py_NewReference((PyObject *)inst);
inst->ob_refcnt = refcnt;
_PyObject_GC_TRACK(inst);
- /* If Py_REF_DEBUG, the original decref dropped _Py_RefTotal,
- * but _Py_NewReference bumped it again, so that's a wash.
- * If Py_TRACE_REFS, _Py_NewReference re-added self to the
- * object chain, so no more to do there either.
+ /* If Py_REF_DEBUG, _Py_NewReference bumped _Py_RefTotal, so
+ * we need to undo that. */
+ _Py_DEC_REFTOTAL;
+ /* If Py_TRACE_REFS, _Py_NewReference re-added self to the
+ * object chain, so no more to do there.
* If COUNT_ALLOCS, the original decref bumped tp_frees, and
- * _Py_NewReference bumped tp_allocs: both of those need to
- * be undone.
+ * _Py_NewReference bumped tp_allocs: both of those need to be
+ * undone.
*/
#ifdef COUNT_ALLOCS
--inst->ob_type->tp_frees;