From 75e18abd585ff81c83f40f374a788b25cdbcf4d0 Mon Sep 17 00:00:00 2001 From: k-chaney Date: Mon, 4 Feb 2019 13:51:56 -0500 Subject: [PATCH] Fix memory leak caused by objects not being cleaned up --- mesh/src/py_visibility.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mesh/src/py_visibility.cpp b/mesh/src/py_visibility.cpp index 1fdeecb..3df5887 100644 --- a/mesh/src/py_visibility.cpp +++ b/mesh/src/py_visibility.cpp @@ -187,8 +187,7 @@ visibility_compute(PyObject *self, PyObject *args, PyObject *keywds) pSensors, min_dist, visibility, normal_dot_cam); if(py_tree == NULL){ - PyObject* py_bin_visibility = PyCObject_FromVoidPtr((void*)search, visibility_destructor); - PyObject* py_normal_dot_cam = PyCObject_FromVoidPtr((void*)search, visibility_destructor); + delete search; } return Py_BuildValue("NN",py_bin_visibility, py_normal_dot_cam);