From 759ce5bc1449a122dfae9e22d218fd90b7f265e5 Mon Sep 17 00:00:00 2001 From: matejcik Date: Fri, 22 Mar 2024 13:30:02 +0100 Subject: [PATCH] fix(core): queue events from iface if all tasks waiting on that iface are gone this juuust might fix unexplained freezes on hardware --- core/src/trezor/loop.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/src/trezor/loop.py b/core/src/trezor/loop.py index 80ed8e160a..f7edc6485c 100644 --- a/core/src/trezor/loop.py +++ b/core/src/trezor/loop.py @@ -93,6 +93,9 @@ def close(task: Task) -> None: """ for iface in _paused: # pylint: disable=consider-using-dict-items _paused[iface].discard(task) + for iface in _paused: # pylint: disable=consider-using-dict-items + if not _paused[iface]: + del _paused[iface] _queue.discard(task) task.close() finalize(task, GeneratorExit())