Skip to content

Commit

Permalink
Desktop: Fix early animation unload deadlocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Willy-JL committed Apr 5, 2024
1 parent 15e5785 commit 6aac86a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
20 changes: 6 additions & 14 deletions applications/services/desktop/scenes/desktop_scene_lock_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,13 +91,9 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) {
if(desktop_pin_is_valid(&desktop->settings.pin_code)) {
desktop_lock(desktop, true);
} else {
LoaderStatus status = loader_start(
desktop->loader, "Desktop", DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG, NULL);
if(status == LoaderStatusOk) {
scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 1);
} else {
FURI_LOG_E(TAG, "Unable to start desktop settings");
}
loader_start_detached_with_gui_error(
desktop->loader, "Destop", DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG);
scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 1);
}
consumed = true;
break;
Expand All @@ -110,13 +106,9 @@ bool desktop_scene_lock_menu_on_event(void* context, SceneManagerEvent event) {
power_off(power);
furi_record_close(RECORD_POWER);
} else {
LoaderStatus status = loader_start(
desktop->loader, "Desktop", DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG, NULL);
if(status == LoaderStatusOk) {
scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 2);
} else {
FURI_LOG_E(TAG, "Unable to start desktop settings");
}
loader_start_detached_with_gui_error(
desktop->loader, "Deskop", DESKTOP_SETTINGS_RUN_PIN_SETUP_ARG);
scene_manager_set_scene_state(desktop->scene_manager, DesktopSceneLockMenu, 2);
}
consumed = true;
break;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ bool desktop_scene_locked_on_event(void* context, SceneManagerEvent event) {
switch(event.event) {
case DesktopLockedEventOpenPowerOff: {
if(momentum_settings.lockscreen_poweroff) {
loader_start(desktop->loader, "Power", "off", NULL);
loader_start_detached_with_gui_error(desktop->loader, "Power", "off");
}
consumed = true;
break;
Expand Down
2 changes: 1 addition & 1 deletion applications/services/desktop/scenes/desktop_scene_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ bool desktop_scene_main_on_event(void* context, SceneManagerEvent event) {
break;

case DesktopMainEventOpenPowerOff: {
loader_start(desktop->loader, "Power", "off", NULL);
loader_start_detached_with_gui_error(desktop->loader, "Power", "off");
consumed = true;
break;
}
Expand Down

0 comments on commit 6aac86a

Please sign in to comment.