For IPCClient, remove entry from instance map on close

Remove the entry from the instance map so
that a closed entry may not be reused.
This forces this operation even if the reference
count of the entry has not yet gone to zero.

Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
This commit is contained in:
Sergey Kizunov 2016-10-03 23:25:24 -05:00 committed by Dmitry Kuzmenko
parent 82e27634a7
commit d7e3209e13

View file

@ -344,6 +344,16 @@ class IPCClient(object):
if self.stream is not None and not self.stream.closed():
self.stream.close()
# Remove the entry from the instance map so
# that a closed entry may not be reused.
# This forces this operation even if the reference
# count of the entry has not yet gone to zero.
if self.io_loop in IPCClient.instance_map:
loop_instance_map = IPCClient.instance_map[self.io_loop]
key = str(self.socket_path)
if key in loop_instance_map:
del loop_instance_map[key]
class IPCMessageClient(IPCClient):
'''