As soon as the last reference to the PyIDispatch object goes away, the COM object is released. Unfortunately, neither Python nor COM offer a way to actually destroy an object - they are both independently reference counted so the only option available is to drop all references being held.
In Python, this means that: ob = win32com.client.Dispatch(.) del ob would cause the object to die (as would assigning 'ob' to something, such as None), but: ob = win32com.client.Dispatch(.) ob2 = ob del ob would not - nothing you can do to 'ob' can help you now - you must also remove the reference in 'ob2' Mark From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Chen Sent: Friday, 29 February 2008 2:13 AM To: python-win32@python.org Subject: [python-win32] How to delete a dispatched object Hi I am wondering how could I delete an dispatched object? Do I just delete the reference to that object? Does python garbage collector take care of everything after I delete the reference? Is there any method which I could use to delete a dispatched object? -- CHEN HUANG COMPUTER Engineering McMaster University
_______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32