-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix memory leak due to ignored constructor flag
Fixes #150 PyArray_NewFromDescr ignores the NPY_ARRAY_OWNDATA flag, so we need to set it manually so that NumPy frees the memory. Also switch memory allocation to use PyDataMem_NEW/FREE. This should generally be the same as PyMem_Malloc, but it could end up different in a situation where the C ext is not linked against the same C stdlib. In that case, NumPy would not call the correct de-allocator when freeing the memory it gains ownership over.
- Loading branch information
Showing
1 changed file
with
46 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters