Commit 241b8345 authored by Martin v. Löwis's avatar Martin v. Löwis

Make obj an owned reference in Py_buffer; this checkin

was missing from the patch for #3139.
parent 9f4e7fee
......@@ -683,6 +683,8 @@ PyBuffer_FillInfo(Py_buffer *view, PyObject *obj, void *buf, Py_ssize_t len,
}
view->obj = obj;
if (obj)
Py_INCREF(obj);
view->buf = buf;
view->len = len;
view->readonly = readonly;
......@@ -710,7 +712,8 @@ PyBuffer_Release(Py_buffer *view)
/* Unmanaged buffer */
return;
Py_TYPE(obj)->tp_as_buffer->bf_releasebuffer(obj, view);
Py_DECREF(obj);
view->obj = NULL;
}
PyObject *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment