From #227, I think we have a Python reference leak to the results structure. Specifically, I think the following pattern results in a leak:
PyObject *ret = PyList_New(0);//create an empty list
...
return Py_BuildValue("(Od)", ret, c_api_time);
PyBuildValue adds a ref, but the PyList_New reference is never decremented. This PR decrements the ref count after building the tuple, before the return.
Once we verify the fix, I'll port it to the other modules.
From #227, I think we have a Python reference leak to the results structure. Specifically, I think the following pattern results in a leak:
PyBuildValue
adds a ref, but thePyList_New
reference is never decremented. This PR decrements the ref count after building the tuple, before the return.Once we verify the fix, I'll port it to the other modules.