[Numpy-discussion] memory not being freed
Paul F Dubois
paul at pfdubois.com
Fri Feb 22 17:29:06 CST 2002
You just want ret = (PyObject*) arr;
I assume it is PyObject *foo() and you just didn't show it.
From: numpy-discussion-admin at lists.sourceforge.net
[mailto:numpy-discussion-admin at lists.sourceforge.net] On Behalf Of
Sent: Friday, February 22, 2002 4:19 PM
To: numpy-discussion at lists.sourceforge.net
Subject: [Numpy-discussion] memory not being freed
I'm having problems with garbage collection
I wrote an extension which creates an array
and returns it
arr = (PyArrayObject *) PyArray_FromDims( .....
ret = Py_BuildValue("O", arr);
but now if I do
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?
Numpy-discussion mailing list Numpy-discussion at lists.sourceforge.net
More information about the Numpy-discussion