COM Shutdown

Mark Hammond MHammond at skippinet.com.au
Thu May 20 05:41:08 EDT 1999


You can find out how many PythonCOM objects are alive at any time by calling
pythoncom._GetInterfaceCount().  If this is zero, shutdown should always be
OK.  If not, you have some immortal objects for some reason...

Alternatively, just try calling pythoncom.CoUninitialize() on the way out.
In builds 124 and before, the hang is almost certainly when PythonCOM is
calling this (but at an inopportune time, causing the hang)

Mark.

Paul Prescod wrote in message <374370AB.E285C993 at prescod.net>...
>I have an app using Automation to talk to Office 2000. It doesn't shut
>down properly. It just hangs when it is done. I'm creating and accessing a
>lot of objects so debugging this will be pretty painful. Does anyone out
>there have any tips?
>
>I can delete everything in the local namespace and it doesn't help:
>
>for key in locals().keys():
>    del locals()[key]
>
>So it doesn't seem to be object deletion but some other shutdown issue.
>Any ideas?







More information about the Python-list mailing list