Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix memory leak in V3fArrayFromBuffer #269

Conversation

cary-ilm
Copy link
Member

Courtesy of @cbreak-black, #266

https://docs.python.org/3/c-api/buffer.html#c.PyBuffer_Release
https://docs.python.org/3/c-api/arg.html

However, when a Py_buffer structure gets filled, the underlying buffer is locked so that the caller can subsequently use the buffer even inside a Py_BEGIN_ALLOW_THREADS block without the risk of mutable data being resized or destroyed. As a result, you have to call PyBuffer_Release() after you have finished processing the data (or in any early abort case).

Signed-off-by: Cary Phillips [email protected]

@meshula meshula merged commit 7206ad1 into AcademySoftwareFoundation:main Oct 13, 2022
cary-ilm added a commit to cary-ilm/Imath that referenced this pull request Oct 31, 2022
cary-ilm added a commit that referenced this pull request Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants