[Numpy-discussion] Solving a memory leak in a numpy extension; PyArray_ContiguousFromObject
Mon Apr 20 08:08:57 CDT 2009
2009/4/20 "V. Armando Solé" <email@example.com>:
> Dan S wrote:
>> But as you can see, my C code doesn't perform any malloc() or
>> suchlike, so I'm stumped.
>> I'd be grateful for any further thoughts
> Could it be your memory leak is in:
> return PyFloat_FromDouble(3.1415927); // temporary
> You are creating a "python float object" from something. What if you
> return Py_None instead of your float?:
> return PyNone;
> I do not know if it will help you but I guess it falls in the "any
> further thought" category :-)
Thanks :) but that doesn't alter things. In fact:
I found the real source of the problem. Namely: I was doing
when I should have been doing
Therefore I was compiling against the old deprecated version of the
lib, which presumably had a memory leak inside itself which got fixed
in the intervening years. Using the up-to-date lib, no leak.
Thanks all, anyway!
More information about the Numpy-discussion