mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-31 15:20:34 +00:00
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:
parent
201796d94f
commit
02ffbf16fe
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user