mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-06 12:51:21 +00:00
fix(core): explicitly delete keyboard layout
- seems that keyboard LayoutObj was not properly deallocated resulting in MemoryError. Fix by calling the dunder `del` method explicitly fixes the issue - the problem was on Model T (Bolt), but applying it for all layouts to prevent similar problem
This commit is contained in:
parent
71306d0904
commit
15967a312b
1
core/.changelog.d/4537.fixed
Normal file
1
core/.changelog.d/4537.fixed
Normal file
@ -0,0 +1 @@
|
||||
[T2T1] Fixed a bug resulting in restarting the recovery flow when inputting 33-word mnemonic.
|
@ -32,21 +32,24 @@ async def request_word(
|
||||
) -> str:
|
||||
prompt = TR.recovery__type_word_x_of_y_template.format(word_index + 1, word_count)
|
||||
can_go_back = word_index > 0
|
||||
|
||||
if is_slip39:
|
||||
keyboard = trezorui_api.request_slip39(
|
||||
prompt=prompt, prefill_word=prefill_word, can_go_back=can_go_back
|
||||
)
|
||||
|
||||
else:
|
||||
keyboard = trezorui_api.request_bip39(
|
||||
prompt=prompt, prefill_word=prefill_word, can_go_back=can_go_back
|
||||
)
|
||||
|
||||
word: str = await interact(
|
||||
keyboard,
|
||||
"mnemonic" if send_button_request else None,
|
||||
ButtonRequestType.MnemonicInput,
|
||||
)
|
||||
try:
|
||||
word: str = await interact(
|
||||
keyboard,
|
||||
"mnemonic" if send_button_request else None,
|
||||
ButtonRequestType.MnemonicInput,
|
||||
)
|
||||
finally:
|
||||
keyboard.__del__()
|
||||
return word
|
||||
|
||||
|
||||
|
@ -31,24 +31,25 @@ async def request_word(
|
||||
prefill_word: str = "",
|
||||
) -> str:
|
||||
prompt = TR.recovery__word_x_of_y_template.format(word_index + 1, word_count)
|
||||
|
||||
can_go_back = word_index > 0
|
||||
|
||||
if is_slip39:
|
||||
keyboard = trezorui_api.request_slip39(
|
||||
prompt=prompt, prefill_word=prefill_word, can_go_back=can_go_back
|
||||
)
|
||||
|
||||
else:
|
||||
keyboard = trezorui_api.request_bip39(
|
||||
prompt=prompt, prefill_word=prefill_word, can_go_back=can_go_back
|
||||
)
|
||||
|
||||
word: str = await interact(
|
||||
keyboard,
|
||||
"mnemonic" if send_button_request else None,
|
||||
ButtonRequestType.MnemonicInput,
|
||||
)
|
||||
try:
|
||||
word: str = await interact(
|
||||
keyboard,
|
||||
"mnemonic" if send_button_request else None,
|
||||
ButtonRequestType.MnemonicInput,
|
||||
)
|
||||
finally:
|
||||
keyboard.__del__()
|
||||
return word
|
||||
|
||||
|
||||
|
@ -33,6 +33,7 @@ async def request_word(
|
||||
) -> str:
|
||||
prompt = TR.recovery__word_x_of_y_template.format(word_index + 1, word_count)
|
||||
can_go_back = word_index > 0
|
||||
|
||||
if is_slip39:
|
||||
keyboard = trezorui_api.request_slip39(
|
||||
prompt=prompt, prefill_word=prefill_word, can_go_back=can_go_back
|
||||
@ -42,11 +43,14 @@ async def request_word(
|
||||
prompt=prompt, prefill_word=prefill_word, can_go_back=can_go_back
|
||||
)
|
||||
|
||||
word: str = await interact(
|
||||
keyboard,
|
||||
"mnemonic" if send_button_request else None,
|
||||
ButtonRequestType.MnemonicInput,
|
||||
)
|
||||
try:
|
||||
word: str = await interact(
|
||||
keyboard,
|
||||
"mnemonic" if send_button_request else None,
|
||||
ButtonRequestType.MnemonicInput,
|
||||
)
|
||||
finally:
|
||||
keyboard.__del__()
|
||||
return word
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user