Skip to content

Commit 879d43b

Browse files
authored
gh-119799: Add missing _Py_IncRefTotal to _Py_NewRefWithLock (#119800)
The free-threaded refleak builds were reporting negative refcount deltas in some tests because of a missing `_Py_NewRefWithLock`.
1 parent 9bc6045 commit 879d43b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Include/internal/pycore_object.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ _Py_NewRefWithLock(PyObject *op)
497497
if (_Py_TryIncrefFast(op)) {
498498
return op;
499499
}
500+
#ifdef Py_REF_DEBUG
501+
_Py_IncRefTotal(_PyThreadState_GET());
502+
#endif
500503
_Py_INCREF_STAT_INC();
501504
for (;;) {
502505
Py_ssize_t shared = _Py_atomic_load_ssize_relaxed(&op->ob_ref_shared);

0 commit comments

Comments
 (0)