remoteloop: properly close the event loop

Close the event loop when the context is exited, which will clear
the internal queues and shut down the executor of the event loop.
Not doing this will create a warning when the object is garbage
collected.
This commit is contained in:
Christian Kellner 2020-07-13 20:43:27 +02:00
parent 291fadd0b2
commit e9c4075bb3

View file

@ -101,6 +101,7 @@ class LoopServer:
def __exit__(self, *args):
self.event_loop.call_soon_threadsafe(self.event_loop.stop)
self.thread.join()
self.event_loop.close()
for lo in self.devs:
lo.close()