Call listener stop only if listener is initialized

Change-Id: I1303d74af7a242edefe774d8f5e12e63614c0158
Closes-Bug: #1785048
This commit is contained in:
Andras Kovi 2018-08-02 13:24:11 +02:00
parent 3a725f957b
commit d8fa6d5edf

View File

@ -426,6 +426,7 @@ class MessageHandlingServer(service.ServiceBase, _OrderedTaskRunner):
some messages, and underlying driver resources associated to this some messages, and underlying driver resources associated to this
server are still in use. See 'wait' for more details. server are still in use. See 'wait' for more details.
""" """
if self.listener:
self.listener.stop() self.listener.stop()
self._started = False self._started = False
@ -443,6 +444,7 @@ class MessageHandlingServer(service.ServiceBase, _OrderedTaskRunner):
self._work_executor.shutdown(wait=True) self._work_executor.shutdown(wait=True)
# Close listener connection after processing all messages # Close listener connection after processing all messages
if self.listener:
self.listener.cleanup() self.listener.cleanup()
def reset(self): def reset(self):