Fix PyBuffer_Release leak

5f38386293 accidentally dropped setting
buffer_info.view, resulting in the buffer never being released (because
view was always nullptr).
This commit is contained in:
Jason Rhinelander 2017-04-14 13:57:49 -04:00
parent 201796d94f
commit 02ffbf16fe

View File

@ -38,10 +38,11 @@ struct buffer_info {
buffer_info(void *ptr, size_t itemsize, const std::string &format, size_t size)
: buffer_info(ptr, itemsize, format, 1, size, itemsize) { }
explicit buffer_info(Py_buffer *view, bool ownview_in = true)
explicit buffer_info(Py_buffer *view, bool ownview = true)
: buffer_info(view->buf, (size_t) view->itemsize, view->format, (size_t) view->ndim,
{view->shape, view->shape + view->ndim}, {view->strides, view->strides + view->ndim}) {
ownview = ownview_in;
this->view = view;
this->ownview = ownview;
}
buffer_info(const buffer_info &) = delete;