Skip to content

Commit 59cd539

Browse files
committed
refactor(core): scope menu-related layouts
May be related to the following OOM: https://github.com/trezor/trezor-firmware/actions/runs/24751684853/job/72416000050 [no changelog]
1 parent be392da commit 59cd539

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

core/src/trezor/ui/layouts/menu.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,13 @@ async def show_menu(
7070
menu = menu.children[i]
7171

7272
if isinstance(menu, Menu):
73-
layout = trezorui_api.select_menu(
73+
with trezorui_api.select_menu(
7474
items=[child.name for child in menu.children],
7575
current=current_item,
7676
cancel=menu.cancel and menu.cancel.name,
77-
)
78-
choice = await interact(layout, br_name=None, raise_on_cancel=None)
77+
) as layout:
78+
choice = await interact(layout, br_name=None, raise_on_cancel=None)
79+
7980
if choice is trezorui_api.CANCELLED:
8081
if menu.cancel:
8182
result = await menu.cancel.factory()

0 commit comments

Comments
 (0)