-
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. Because we now don't (can't) set the flag in this call, simplify construction by using PyArray_SimpleNewFromData. Now that memory is being freed correctly, we must use the NumPy allocator (PyDataMem_NEW/FREE) so that de-allocation is matched.
- Loading branch information
Showing
1 changed file
with
42 additions
and
30 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