]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Get ordering right for TRACE_REFS/COUNT_ALLOCS combination (otherwise
authorSjoerd Mullender <sjoerd@acm.org>
Mon, 18 Sep 1995 10:49:04 +0000 (10:49 +0000)
committerSjoerd Mullender <sjoerd@acm.org>
Mon, 18 Sep 1995 10:49:04 +0000 (10:49 +0000)
may get inc_count sanity check abort).

Objects/classobject.c

index 94ed2db2026b2d58cfca9a37ef320cc0e390e77c..550ee1cb4f5314447135814cd87afbedabb05798 100644 (file)
@@ -351,11 +351,11 @@ instance_dealloc(inst)
        /* much too complicated if TRACE_REFS defined */
        extern long ref_total;
        inst->ob_type = &Instancetype;
+       NEWREF(inst);
        ref_total--;            /* compensate for increment in NEWREF */
 #ifdef COUNT_ALLOCS
        inst->ob_type->tp_alloc--; /* ditto */
 #endif
-       NEWREF(inst);
 #else
        INCREF(inst);
 #endif /* TRACE_REFS */