ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> pyxpcom
pyxpcom
[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

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved