diff --git a/news/fix_pyarray_ref.rst b/news/fix_pyarray_ref.rst new file mode 100644 index 0000000..4f2b7ca --- /dev/null +++ b/news/fix_pyarray_ref.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Fix memory leak in makeNdArray + +**Security:** + +* diff --git a/src/extensions/registerconverters.cpp b/src/extensions/registerconverters.cpp index e421487..bac7484 100644 --- a/src/extensions/registerconverters.cpp +++ b/src/extensions/registerconverters.cpp @@ -61,7 +61,7 @@ PyObject* makeNdArray(const double* data, std::vector& dims) PyArrayObject* a = reinterpret_cast(pyarray); double* adata = static_cast(PyArray_DATA(a)); std::copy(data, data + PyArray_SIZE(a), adata); - return bp::incref(pyarray); + return pyarray; } // CrystVector to ndarray