[pyxpcom] memory leak in PyIClassInfo.cpp
by Jiangweiran other posts by this author
Jul 10 2007 8:41PM messages near this date
view in the new Beta List Site
Re: [pyxpcom] python and xbl
|
Re: [pyxpcom] memory leak in PyIClassInfo.cpp
Hello All:
I found some memory leak in PyIClassInfo.cpp.
in function static PyObject *PyGetInterfaces(PyObject *self, PyObject *args)��it see
ms the iidArray and all iid in the array is leaking,so I add these lines before returning:
if (ret==NULL)
return NULL;
for (PRUint32 i=0;i<iidCount;i++)
PyTuple_SET_ITEM( ret, i, Py_nsIID::PyObjectFromIID(*(iidArray[i])) );
//freeing iid in the array and array itself
+ for (PRUint32 i=0;i<iidCount;i++)
+ nsMemory::Free(iidArray[i]);
+ nsMemory:Free(iidArray);
return ret;
can anyone confirm this fixes?thanks
jiangweiran
2007-07-11
Thread:
Jiangweiran
Mark Hammond
|