App crash bugfixes

- BLE Spam: Fix icon position
- Hex Viewer: Fix view alloc/free
- Chess: Fix view alloc/free
- UHF RFID: Fix view alloc/free
This commit is contained in:
Willy-JL
2024-03-21 04:42:01 +00:00
parent 8b69bae52c
commit 2f7dfe434b
2 changed files with 8 additions and 7 deletions

View File

@@ -45,9 +45,6 @@ HexViewer* hex_viewer_app_alloc() {
view_dispatcher_set_custom_event_callback(
app->view_dispatcher, hex_viewer_custom_event_callback);
app->submenu = submenu_alloc();
app->text_input = text_input_alloc();
// Set defaults, in case no config loaded
app->haptic = 1;
app->speaker = 1;
@@ -61,6 +58,7 @@ HexViewer* hex_viewer_app_alloc() {
// Load configs
hex_viewer_read_settings(app);
app->submenu = submenu_alloc();
view_dispatcher_add_view(
app->view_dispatcher, HexViewerViewIdMenu, submenu_get_view(app->submenu));
@@ -70,6 +68,7 @@ HexViewer* hex_viewer_app_alloc() {
HexViewerViewIdStartscreen,
hex_viewer_startscreen_get_view(app->hex_viewer_startscreen));
app->text_input = text_input_alloc();
view_dispatcher_add_view(
app->view_dispatcher, HexViewerViewIdScroll, text_input_get_view(app->text_input));
@@ -97,11 +96,13 @@ void hex_viewer_app_free(HexViewer* app) {
// View Dispatcher
view_dispatcher_remove_view(app->view_dispatcher, HexViewerViewIdMenu);
view_dispatcher_remove_view(app->view_dispatcher, HexViewerViewIdScroll);
view_dispatcher_remove_view(app->view_dispatcher, HexViewerViewIdSettings);
submenu_free(app->submenu);
view_dispatcher_remove_view(app->view_dispatcher, HexViewerViewIdStartscreen);
hex_viewer_startscreen_free(app->hex_viewer_startscreen);
view_dispatcher_remove_view(app->view_dispatcher, HexViewerViewIdScroll);
text_input_free(app->text_input);
view_dispatcher_remove_view(app->view_dispatcher, HexViewerViewIdSettings);
variable_item_list_free(app->variable_item_list);
view_dispatcher_free(app->view_dispatcher);
furi_record_close(RECORD_STORAGE);