[Numpy-tickets] [NumPy] #394: Memory leak in .argsort() method

NumPy numpy-tickets at scipy.net
Mon Dec 4 12:00:31 CST 2006


#394: Memory leak in .argsort() method
--------------------+-------------------------------------------------------
 Reporter:  faltet  |        Owner:  somebody
     Type:  defect  |       Status:  new     
 Priority:  normal  |    Milestone:          
Component:  Other   |      Version:  devel   
 Severity:  normal  |   Resolution:          
 Keywords:          |  
--------------------+-------------------------------------------------------
Comment (by faltet):

 Mmm, you should consider applying this one instead:

 {{{
 --- numpy/core/src/multiarraymodule.c.orig      2006-12-04
 18:50:37.000000000 +0
 100
 +++ numpy/core/src/multiarraymodule.c   2006-12-04 18:49:14.000000000
 +0100
 @@ -2488,6 +2488,7 @@

         if ((op2=(PyAO *)_check_axis(op, &axis, 0))==NULL) return NULL;

 +        Py_DECREF(op);
         /* Determine if we should use new algorithm or not */
         if (op2->descr->f->argsort[which] != NULL) {
                 return _new_argsort(op2, axis, which);
 }}}

 as it always decref op (and not only sometimes).

-- 
Ticket URL: <http://projects.scipy.org/scipy/numpy/ticket/394#comment:1>
NumPy <http://projects.scipy.org/scipy/numpy>
The fundamental package needed for scientific computing with Python.


More information about the Numpy-tickets mailing list