gui: fix RPC client teardown

This commit is contained in:
Sebastien Bourdeauducq 2015-11-01 00:03:46 +08:00
parent 8e24a018ea
commit a2c074cc33
1 changed files with 2 additions and 2 deletions

View File

@ -67,14 +67,14 @@ def main():
app = QtGui.QApplication([]) app = QtGui.QApplication([])
loop = QEventLoop(app) loop = QEventLoop(app)
asyncio.set_event_loop(loop) asyncio.set_event_loop(loop)
atexit.register(lambda: loop.close()) atexit.register(loop.close)
rpc_clients = dict() rpc_clients = dict()
for target in "schedule", "repository", "dataset_db": for target in "schedule", "repository", "dataset_db":
client = AsyncioClient() client = AsyncioClient()
loop.run_until_complete(client.connect_rpc( loop.run_until_complete(client.connect_rpc(
args.server, args.port_control, "master_" + target)) args.server, args.port_control, "master_" + target))
atexit.register(lambda: client.close_rpc()) atexit.register(client.close_rpc)
rpc_clients[target] = client rpc_clients[target] = client
smgr = StateManager(args.db_file) smgr = StateManager(args.db_file)