From 3b9120e2ab712a451a8c0e2215fb03344d2e3a13 Mon Sep 17 00:00:00 2001 From: Pariterre Date: Thu, 15 Feb 2024 11:06:21 -0500 Subject: [PATCH] Fixed memory leak when to_array() is used in Python --- binding/python3/ezc3d_python.i | 1 + 1 file changed, 1 insertion(+) diff --git a/binding/python3/ezc3d_python.i b/binding/python3/ezc3d_python.i index e22d4245..010ee949 100644 --- a/binding/python3/ezc3d_python.i +++ b/binding/python3/ezc3d_python.i @@ -495,6 +495,7 @@ PyArrayObject *helper_getPyArrayObject( PyObject *input, int type) { } PyObject* output = PyArray_SimpleNewFromData(nArraySize,arraySizes,NPY_DOUBLE, mat); PyArray_ENABLEFLAGS((PyArrayObject *)output, NPY_ARRAY_OWNDATA); + delete[] arraySizes; return output; }; }