From 388ae44cf2291208a6696f0d280d97b00c58b802 Mon Sep 17 00:00:00 2001 From: Blake Harnden <32446120+bharnden@users.noreply.github.com> Date: Mon, 4 Apr 2022 09:15:34 -0700 Subject: [PATCH] daemon: small adjustment/cleanup to shutting down all sessions from coreemu --- daemon/core/emulator/coreemu.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/daemon/core/emulator/coreemu.py b/daemon/core/emulator/coreemu.py index 9baadb54..3a9c847b 100644 --- a/daemon/core/emulator/coreemu.py +++ b/daemon/core/emulator/coreemu.py @@ -140,10 +140,8 @@ class CoreEmu: :return: nothing """ logger.info("shutting down all sessions") - sessions = self.sessions.copy() - self.sessions.clear() - for _id in sessions: - session = sessions[_id] + while self.sessions: + _, session = self.sessions.popitem() session.shutdown() def create_session(self, _id: int = None, _cls: Type[Session] = Session) -> Session: