Skip to content

Commit 39cbf1f

Browse files
Update 2026-04-10-16-19-23.gh-issue-148263.trqp3-.rst
1 parent eb3cfe6 commit 39cbf1f

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed
Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
Fix refcount leak in weakref proxy operations:
2-
When a weakref proxy was used in binary, ternary, or rich comparison operations
3-
and the second argument turned out to be a dead proxy, the first argument's
4-
reference count was already incremented by the unwrap step but never released,
5-
causing a memory leak.This patch replaces the old UNWRAP macro with
6-
a proper inline function _proxy_unwrap() that tracks whether each
7-
argument was incref'd, and introduces cleanup paths (goto clean_up)
8-
that correctly decref any already-acquired references before
9-
returning NULL on failure. Also added reference cleanup in unary and compare
10-
operations.
11-
1+
Fix refcount leak in weakref proxy operations: When a weakref proxy was used in binary,
2+
ternary, or rich comparison operations and the second argument turned out to be a dead
3+
proxy, the first argument's reference count was already incremented by the unwrap step
4+
but never released, causing a memory leak.This patch replaces the old UNWRAP macro with
5+
a proper inline function _proxy_unwrap() that tracks whether each argument was incref'd,
6+
and introduces cleanup paths (goto clean_up) that correctly decref any already-acquired
7+
references before returning NULL on failure. Also added reference cleanup in unary and
8+
compare operations.

0 commit comments

Comments
 (0)