Stefan Krah added the comment: Richard Oudkerk <rep...@bugs.python.org> wrote: > Should PyMemoryView_Release() release the _PyManagedBufferObject by doing > mbuf_release(view->mbuf) even if view->mbuf->exports > 0?
No, I think it should really just be a wrapper: diff --git a/Objects/memoryobject.c b/Objects/memoryobject.c --- a/Objects/memoryobject.c +++ b/Objects/memoryobject.c @@ -1093,6 +1093,12 @@ return memory_release((PyMemoryViewObject *)self, NULL); } +PyObject * +PyMemoryView_Release(PyObject *m) +{ + return memory_release((PyMemoryViewObject *)m, NULL); +} + We decided in #10181 not to allow releasing a view with exports, since the logic is already quite complex. Is there a reasonable expectation that existing code creates memoryviews of the readinto() argument? ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15903> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com