Michael Eddington schrieb:
> After additional digging I found were the leek appears to be.  It
> occurs in COMObject::__make_interface_pointer with the following
> lines:
> 
>         for iid in iids:
>             self._com_pointers_[iid] = pointer(pointer(vtbl))
> 
> I'm not sure why that the items in _com_pointers_ do not get free'd,
> but as a work around I added the following to IUnknown_Release which
> seems to resolve the issue (not much testing though).
> 
>         if result == 0:
>             self.__unkeep__(self)
>             # new code to fix leek
>             self._com_pointers_ = {}
> 

Ah - great patch!

> My guess is some part of creating the methods array in
> __make_interface_pointer causes a reference to our class is a part of
> the method  deinition then added to the vtbl which is then added to
> self._com_pointers_ creating a typical python memory leek...

I do not understand either why this isn't eventually collected by
the cycle gc, but your patch fixes the problem.  Thanks!
I've committed it to SVN.

Thomas

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
comtypes-users mailing list
comtypes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/comtypes-users

Reply via email to