Menu ▾ ▴

#167 Memory leak in regrid._regrid

open
nobody
None
5
2012-12-10
2007-09-18
Anonymous
No

The regrid module appears to have a series of memory leaks in the interpolation functions.

In _regridmodule.c each return value uses a Py_BuildValue without Py_DECREF. e.g.:

Line 327:
return Py_BuildValue(("OO"), object_wts, object_bnds);

I think it should be something more like

PyObject *outdat;
---Snip----
outdat=Py_BuildValue(("OO"), object_wts, object_bnds);
Py_DECREF(object_wts);
Py_DECREF(object_bnds);
return outdat;

This change eliminated the leak problems we were having with recursively calling the regridder.

Discussion


Log in to post a comment.