> I'm experimenting with a pythoncom client which uses a ctypes.com
> server.  I have the impression that DispatchWithEvents somehow doesn't
> clean up correctly.

That is possible.  Most leaks of COM objects should be evident by querying
pythoncom._GetInterfaceCount() and pythoncom._GetGatewayCount() - it would
be interesting to know if these were both zero and you still had the
problem.

> Is there a reason why pythoncom doesn't call CoUninitialize() itself?

We had a few problems trying to do that.  In some cases when not all COM
objects were explicitly closed, we found that system shutdown time could
cause the object to attempt to release the COM pointer - but *after*
CoUninit had been called.  But I have found very few errors *not* calling
it - especially when all COM objects have been cleaned up.  I guess that is
really just a matter of finding the correct hook (but note that in a COM DLL
case, Python itself will never be Uninitialized!

Mark

_______________________________________________
Python-win32 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to