From: Paul F D. <pa...@pf...> - 2002-02-23 01:28:20
|
You just want ret = (PyObject*) arr; I assume it is PyObject *foo() and you just didn't show it. -----Original Message----- From: num...@li... [mailto:num...@li...] On Behalf Of Mathew Yeates Sent: Friday, February 22, 2002 4:19 PM To: num...@li... Subject: [Numpy-discussion] memory not being freed Hi I'm having problems with garbage collection I wrote an extension which creates an array and returns it foo() { arr = (PyArrayObject *) PyArray_FromDims( ..... ret = Py_BuildValue("O", arr); return ret; } but now if I do while 1: a=foo() memory is never free'd. I've even tried explicitly calling gc.collect and adding del(a) after a=foo. Is the problem that Py_BuildValue increases the reference count? Mathew _______________________________________________ Numpy-discussion mailing list Num...@li... https://lists.sourceforge.net/lists/listinfo/numpy-discussion |