Skip to content

Commit 2a4d275

Browse files
Revert "remove unnecessary mem leak handling in unary and wrap method"
This reverts commit ddf4a6a.
1 parent be3f7d0 commit 2a4d275

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

Objects/weakrefobject.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,7 +561,8 @@ _proxy_unwrap(PyObject **op, int *did_incref)
561561
static PyObject * \
562562
method(PyObject *proxy) { \
563563
int proxy_incref = 0; \
564-
UNWRAP(proxy); \
564+
if (!_proxy_unwrap(&proxy, &proxy_incref)) \
565+
return NULL; \
565566
PyObject* res = generic(proxy); \
566567
Py_DECREF(proxy); \
567568
return res; \
@@ -615,7 +616,8 @@ _proxy_unwrap(PyObject **op, int *did_incref)
615616
static PyObject * \
616617
method(PyObject *proxy, PyObject *Py_UNUSED(ignored)) { \
617618
int proxy_incref = 0; \
618-
UNWRAP(proxy); \
619+
if (!_proxy_unwrap(&proxy, &proxy_incref)) \
620+
return NULL; \
619621
PyObject* res = PyObject_CallMethodNoArgs(proxy, &_Py_ID(SPECIAL)); \
620622
Py_DECREF(proxy); \
621623
return res; \

0 commit comments

Comments
 (0)