Skip to content

Commit

Permalink
Fix view alloc/free
Browse files Browse the repository at this point in the history
by Willy-JL
  • Loading branch information
xMasterX committed Mar 22, 2024
1 parent 8245889 commit 7172669
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
11 changes: 7 additions & 4 deletions non_catalog_apps/chess/flipchess.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ FlipChess* flipchess_app_alloc() {
app->view_dispatcher, flipchess_tick_event_callback, 100);
view_dispatcher_set_custom_event_callback(
app->view_dispatcher, flipchess_custom_event_callback);
app->submenu = submenu_alloc();

// Settings
app->haptic = FlipChessHapticOn;
Expand All @@ -89,6 +88,7 @@ FlipChess* flipchess_app_alloc() {
// Text input
app->input_state = FlipChessTextInputDefault;

app->submenu = submenu_alloc();
view_dispatcher_add_view(
app->view_dispatcher, FlipChessViewIdMenu, submenu_get_view(app->submenu));
app->flipchess_startscreen = flipchess_startscreen_alloc();
Expand Down Expand Up @@ -131,14 +131,17 @@ void flipchess_app_free(FlipChess* app) {
// Scene manager
scene_manager_free(app->scene_manager);

text_input_free(app->text_input);

// View Dispatcher
view_dispatcher_remove_view(app->view_dispatcher, FlipChessViewIdMenu);
submenu_free(app->submenu);
view_dispatcher_remove_view(app->view_dispatcher, FlipChessViewIdStartscreen);
flipchess_startscreen_free(app->flipchess_startscreen);
view_dispatcher_remove_view(app->view_dispatcher, FlipChessViewIdScene1);
flipchess_scene_1_free(app->flipchess_scene_1);
view_dispatcher_remove_view(app->view_dispatcher, FlipChessViewIdSettings);
variable_item_list_free(app->variable_item_list);
view_dispatcher_remove_view(app->view_dispatcher, FlipChessViewIdTextInput);
submenu_free(app->submenu);
text_input_free(app->text_input);

view_dispatcher_free(app->view_dispatcher);
furi_record_close(RECORD_GUI);
Expand Down
7 changes: 4 additions & 3 deletions non_catalog_apps/uhf_rfid/uhf_app.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,10 @@ UHFApp* uhf_alloc() {
void uhf_free(UHFApp* uhf_app) {
furi_assert(uhf_app);

// Variable Item List
view_dispatcher_remove_view(uhf_app->view_dispatcher, UHFViewVariableItemList);
variable_item_list_free(uhf_app->variable_item_list);

// Submenu
view_dispatcher_remove_view(uhf_app->view_dispatcher, UHFViewMenu);
submenu_free(uhf_app->submenu);
Expand Down Expand Up @@ -151,9 +155,6 @@ void uhf_free(UHFApp* uhf_app) {
furi_record_close(RECORD_GUI);
uhf_app->gui = NULL;

// Variable Item List
variable_item_list_free(uhf_app->variable_item_list);

// Notifications
furi_record_close(RECORD_NOTIFICATION);
uhf_app->notifications = NULL;
Expand Down

0 comments on commit 7172669

Please sign in to comment.