Commit 7ec6b8a8 authored by Stefan Behnel's avatar Stefan Behnel

Merge branch 'release'

parents 1baac19e ebd45911
......@@ -52,6 +52,11 @@ Bugs fixed
* ``cython.view.array`` was missing ``.__len__()``.
* Extension types with a ``.pxd`` override for their ``__releasebuffer__`` slot
(e.g. as provided by Cython for the Python ``array.array`` type) could leak
a reference to the buffer owner on release, thus not freeing the memory.
(Github issue #1638)
* Invalid C code in generators (declaration after code).
(Github issue #1801)
......
......@@ -128,14 +128,15 @@ static void __Pyx_ReleaseBuffer(Py_buffer *view) {
return;
}
if ((0));
{{for type_ptr, getbuffer, releasebuffer in types}}
{{if releasebuffer}}
if (__Pyx_TypeCheck(obj, {{type_ptr}})) { {{releasebuffer}}(obj, view); return; }
else if (__Pyx_TypeCheck(obj, {{type_ptr}})) {{releasebuffer}}(obj, view);
{{endif}}
{{endfor}}
Py_DECREF(obj);
view->obj = NULL;
Py_DECREF(obj);
}
#endif /* PY_MAJOR_VERSION < 3 */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment