mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
Properly INCREF reference in Py_buffer.
This commit is contained in:
parent
241b8345ea
commit
8401eec7fa
1 changed files with 2 additions and 0 deletions
|
|
@ -2516,6 +2516,8 @@ static int CData_NewGetBuffer(PyObject *_self, Py_buffer *view, int flags)
|
|||
if (view == NULL) return 0;
|
||||
|
||||
view->buf = self->b_ptr;
|
||||
view->obj = _self;
|
||||
Py_INCREF(_self);
|
||||
view->len = self->b_size;
|
||||
view->readonly = 0;
|
||||
/* use default format character if not set */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue