Properly INCREF reference in Py_buffer.

This commit is contained in:
Martin v. Löwis 2008-08-14 15:56:07 +00:00
parent 241b8345ea
commit 8401eec7fa
1 changed files with 2 additions and 0 deletions

View File

@ -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 */