Bo Peng wrote:
>> Sorry, are you saying that the code you posted does NOT have a memory 
>> leak, but you want us to find the memory leak in your real code sight 
>> unseen?

Problem found. It is hidden in a utility function that converts the 
return value to a double.  The refcnt of the middle result was not 
decreased.

     PyObject* res = PyNumber_Float(obj);
     val = PyFloat_AsDouble(res);
     // missing
     Py_DECREF(res);

The problem is not that difficult to find, but it was 2am in the morning 
and I was misled by the different behavior of pyFun1 and pyFun2.

Thanks,
Bo
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to