diff --git a/mesh/src/py_visibility.cpp b/mesh/src/py_visibility.cpp index 6c5ac0f..6a0e193 100644 --- a/mesh/src/py_visibility.cpp +++ b/mesh/src/py_visibility.cpp @@ -199,8 +199,7 @@ visibility_compute(PyObject *self, PyObject *args, PyObject *keywds) pSensors, min_dist, visibility, normal_dot_cam); if(py_tree == NULL){ - PyObject* py_bin_visibility = PyCapsule_New((void*)search, NULL, visibility_destructor); - PyObject* py_normal_dot_cam = PyCapsule_New((void*)search, NULL, visibility_destructor); + delete search; } return Py_BuildValue("NN",py_bin_visibility, py_normal_dot_cam);