mirror of
https://github.com/hakril/PythonForWindows
synced 2026-06-08 14:31:45 +00:00
Improve AlpcClient/Server __del__ method
This commit is contained in:
@@ -437,6 +437,8 @@ class AlpcClient(AlpcTransportBase):
|
||||
def disconnect(self):
|
||||
if self.handle:
|
||||
self._close_port(self.handle)
|
||||
self.handle = None
|
||||
|
||||
|
||||
def __del__(self):
|
||||
if sys.path is not None:
|
||||
@@ -531,8 +533,10 @@ class AlpcServer(AlpcTransportBase):
|
||||
def disconnect(self):
|
||||
if self.handle:
|
||||
self._close_port(self.handle)
|
||||
self.handle = None
|
||||
for com_port_handle in self.communication_port_list:
|
||||
self._close_port(com_port_handle)
|
||||
del self.communication_port_list[:]
|
||||
|
||||
# TODO: add an API to close a communication port ?
|
||||
|
||||
|
||||
@@ -60,13 +60,13 @@ def stubborn_create_instance(clsid, iid):
|
||||
|
||||
resolver_info = rpiv_infoptr[0]
|
||||
if resolver_info.OxidInfo.containerVersion.version > 3:
|
||||
print("resolver_info.OxidInfo.containerVersion.version == {0}".format(resolver_info.OxidInfo.containerVersion.version))
|
||||
# print("resolver_info.OxidInfo.containerVersion.version == {0}".format(resolver_info.OxidInfo.containerVersion.version))
|
||||
print("Probable bad structure ! -> cast to legacy !")
|
||||
resolver_info = ctypes.cast(rpiv_infoptr, gdef.PPRIV_RESOLVER_INFO_LEGACY)[0]
|
||||
|
||||
print("")
|
||||
# print("")
|
||||
psa = resolver_info.OxidInfo.psa[0] # Retrieve the bidings to our COM server
|
||||
print("psa.bidings: {0}".format(psa.bidings))
|
||||
# print("psa.bidings: {0}".format(psa.bidings))
|
||||
# ipidRemUnknown = resolver_info.OxidInfo.ipidRemUnknown # Useful for IRemQueryInterface
|
||||
|
||||
# Retrieve info about the IPID from GetMarshalledResults
|
||||
|
||||
Reference in New Issue
Block a user