Skip to content

Commit 266c2e7

Browse files
Revert "remove unnecessary mem leak handling in unary and wrap method"
This reverts commit ddf4a6a.
1 parent e839f46 commit 266c2e7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Objects/weakrefobject.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,8 @@ _proxy_unwrap(PyObject **op, int *did_incref)
576576
static PyObject * \
577577
method(PyObject *proxy) { \
578578
int proxy_incref = 0; \
579-
UNWRAP(proxy); \
579+
if (!_proxy_unwrap(&proxy, &proxy_incref)) \
580+
return NULL; \
580581
PyObject* res = generic(proxy); \
581582
Py_DECREF(proxy); \
582583
return res; \
@@ -630,7 +631,8 @@ _proxy_unwrap(PyObject **op, int *did_incref)
630631
static PyObject * \
631632
method(PyObject *proxy, PyObject *Py_UNUSED(ignored)) { \
632633
int proxy_incref = 0; \
633-
UNWRAP(proxy); \
634+
if (!_proxy_unwrap(&proxy, &proxy_incref)) \
635+
return NULL; \
634636
PyObject* res = PyObject_CallMethodNoArgs(proxy, &_Py_ID(SPECIAL)); \
635637
Py_DECREF(proxy); \
636638
return res; \

0 commit comments

Comments
 (0)