Skip to content

Commit be3f7d0

Browse files
Revert "remove unnecessary mem leak handling in unary and wrap method 1"
This reverts commit 033be36.
1 parent 9bf25c6 commit be3f7d0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

Objects/weakrefobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,7 @@ _proxy_unwrap(PyObject **op, int *did_incref)
560560
#define WRAP_UNARY(method, generic) \
561561
static PyObject * \
562562
method(PyObject *proxy) { \
563+
int proxy_incref = 0; \
563564
UNWRAP(proxy); \
564565
PyObject* res = generic(proxy); \
565566
Py_DECREF(proxy); \
@@ -613,6 +614,7 @@ _proxy_unwrap(PyObject **op, int *did_incref)
613614
#define WRAP_METHOD(method, SPECIAL) \
614615
static PyObject * \
615616
method(PyObject *proxy, PyObject *Py_UNUSED(ignored)) { \
617+
int proxy_incref = 0; \
616618
UNWRAP(proxy); \
617619
PyObject* res = PyObject_CallMethodNoArgs(proxy, &_Py_ID(SPECIAL)); \
618620
Py_DECREF(proxy); \

0 commit comments

Comments
 (0)