Skip to content

Commit

Permalink
Fix LVGL 8.4 crash post delete screens
Browse files Browse the repository at this point in the history
  • Loading branch information
xperiments committed Jun 19, 2024
1 parent aef9f83 commit ba4e25a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/ui/ui_loaders.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,7 @@ void fillScreenData(int screen)
void loadScreen(int screen)
{
xTouchConfig.currentScreenIndex = screen;
lv_obj_t *current = lv_scr_act();
if (current != NULL)
{
lv_obj_clean(current);
lv_obj_del(current);
}
lv_obj_t *previousScreen = lv_scr_act();

switch (screen)
{
Expand Down Expand Up @@ -93,6 +88,12 @@ void loadScreen(int screen)
{
ui_sidebarComponent_set_active(screen);
}

if (previousScreen != NULL)
{
lv_obj_clean(previousScreen);
lv_obj_del(previousScreen);
}
}

void initTopLayer()
Expand Down

0 comments on commit ba4e25a

Please sign in to comment.