Memory leak in C implementation of object proxy when instance method called via class and instance passed in explicitly.
This commit is contained in:
@@ -6,6 +6,11 @@ Version 1.2.0
|
||||
|
||||
**Bugs Fixed**
|
||||
|
||||
* Python object memory leak was occuring due to incorrect increment of
|
||||
object reference count in C implementation of object proxy when an
|
||||
instance method was called via the class and the instance passed in
|
||||
explicitly.
|
||||
|
||||
* In place operators in pure Python object proxy for __idiv__ and
|
||||
__itruediv__ were not replacing the wrapped object with the result
|
||||
of the operation on the wrapped object.
|
||||
|
||||
@@ -1939,13 +1939,11 @@ static PyObject *WraptBoundMethodWrapper_call(
|
||||
object = PyObject_CallFunction(partial, "(OO)",
|
||||
self->object_proxy.wrapped, instance);
|
||||
|
||||
if (object) {
|
||||
Py_INCREF(object);
|
||||
wrapped = object;
|
||||
}
|
||||
else
|
||||
if (!object)
|
||||
return NULL;
|
||||
|
||||
wrapped = object;
|
||||
|
||||
param_args = PyTuple_GetSlice(args, 1, PyTuple_Size(args));
|
||||
if (!param_args)
|
||||
return NULL;
|
||||
@@ -1971,7 +1969,7 @@ static PyObject *WraptBoundMethodWrapper_call(
|
||||
Py_DECREF(call_args);
|
||||
Py_XDECREF(param_args);
|
||||
Py_XDECREF(param_kwds);
|
||||
Py_XDECREF(wrapped);
|
||||
Py_DECREF(wrapped);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user