From 5ad4841b09f3115d5d31bf4326f4bd055b7ce8f0 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 9976ec339..4f3f41e2a 100644 --- a/core/src/trezor/loop.py +++ b/core/src/trezor/loop.py @@ -90,6 +90,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())