[python-win32] COM Release

Mark Hammond mhammond at skippinet.com.au
Tue Aug 16 01:35:13 CEST 2005


You need to release all Python references to any COM objects in use.
Generally this can simply mean setting the object to None, thereby releasing
any reference the object had.

pythoncom._GetInterfaceCount() will tell you how many COM references still
exist and aid you in tracking them down.

Mark

> -----Original Message-----
> From: python-win32-bounces at python.org
> [mailto:python-win32-bounces at python.org]On Behalf Of Timothy Fitz
> Sent: Tuesday, 16 August 2005 9:00 AM
> To: python-win32 at python.org
> Subject: [python-win32] COM Release
>
>
> Is there an explicit way to Release a COM object?
>
> The iTunes COM api raises an event right before it closes, and if my
> application doesn't release the COM object in response, iTunes will
> hang for 5 seconds, and then prompt the user if they want to force it
> to close (very ugly!)
> _______________________________________________
> Python-win32 mailing list
> Python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32



More information about the Python-win32 mailing list