Skip to content

Commit e839f46

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

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Objects/weakrefobject.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -575,6 +575,7 @@ _proxy_unwrap(PyObject **op, int *did_incref)
575575
#define WRAP_UNARY(method, generic) \
576576
static PyObject * \
577577
method(PyObject *proxy) { \
578+
int proxy_incref = 0; \
578579
UNWRAP(proxy); \
579580
PyObject* res = generic(proxy); \
580581
Py_DECREF(proxy); \
@@ -628,6 +629,7 @@ _proxy_unwrap(PyObject **op, int *did_incref)
628629
#define WRAP_METHOD(method, SPECIAL) \
629630
static PyObject * \
630631
method(PyObject *proxy, PyObject *Py_UNUSED(ignored)) { \
632+
int proxy_incref = 0; \
631633
UNWRAP(proxy); \
632634
PyObject* res = PyObject_CallMethodNoArgs(proxy, &_Py_ID(SPECIAL)); \
633635
Py_DECREF(proxy); \

0 commit comments

Comments
 (0)