From: Daniel W. <dan...@gm...> - 2010-06-03 19:41:00
|
Can I do a 1.1.1 release? Any objections? Find() method is quite important for fipy right now. On Thu, Jun 3, 2010 at 10:10 AM, Dominique Orban <dom...@gm...> wrote: > Yes please. Thanks for finding this bug! > > On Thu, Jun 3, 2010 at 3:47 PM, Daniel Wheeler > <dan...@gm...> wrote: >> Shall I do this on the version 1.1 branch and trunk? >> >> 2010/6/3 Dominique Orban <dom...@gm...>: >>> 2010/6/3 Łukasz Pankowski <lu...@o2...>: >>>> Daniel Wheeler <dan...@gm...> writes: >>>> >>>>> It seems that the find() method (lin 2986 in in Src/ll_mat.c) has a >>>>> memory leak. Calling PyDECREF on a_row, a_col and a_val fixes this >>>>> issue. I propose the following change: >>>> >>>> I propose simpler (`N' is like `O' but without PyINCREF, details below): >>>> >>>> $ git diff >>>> diff --git a/Src/ll_mat.c b/Src/ll_mat.c >>>> index 230829a..1adee2f 100644 >>>> --- a/Src/ll_mat.c >>>> +++ b/Src/ll_mat.c >>>> @@ -3014,7 +3014,7 @@ static PyObject *LLMat_Find( LLMatObject *self, PyObject *args ) { >>>> } >>>> } >>>> >>>> - return Py_BuildValue( "OOO", >>>> + return Py_BuildValue( "NNN", >>>> PyArray_Return( a_val ), >>>> PyArray_Return( a_row ), >>>> PyArray_Return( a_col ) ); >>>> >>>> >>>> from File: python2.5-api.info, Node: Parsing arguments and building values >>>> >>>> ``N' (object) {[PyObject * }]' >>>> Same as `O', except it doesn't increment the reference count >>>> on the object. Useful when the object is created by a call >>>> to an object constructor in the argument list. >>> >>> Thanks. I fixed it in the new-setup branch as well. >>> >>> -- >>> Dominique >>> >> >> >> >> -- >> Daniel Wheeler >> > > > > -- > Dominique > -- Daniel Wheeler |