Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Memory Corruption While Closing UI #449

Merged
merged 1 commit into from
Aug 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/app/ui/root.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ void ui_cb_destroy_fragment(lv_event_t *e) {
}

SDL_Window *app_ui_create_window(app_ui_t *ui) {
Uint32 win_flags = SDL_WINDOW_RESIZABLE;
Uint32 win_flags = SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI;
int win_x = SDL_WINDOWPOS_UNDEFINED, win_y = SDL_WINDOWPOS_UNDEFINED,
win_width = 1920, win_height = 1080;
if (app_configuration->fullscreen) {
Expand Down
17 changes: 14 additions & 3 deletions src/app/ui/ui_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ void app_ui_input_deinit(app_ui_input_t *input) {
lv_indev_delete(input->wheel.indev);
lv_indev_delete(input->button.indev);

input->key.indev = NULL;
input->pointer.indev = NULL;
input->wheel.indev = NULL;
input->button.indev = NULL;

_lv_ll_clear(&input->modal_groups);
}

Expand Down Expand Up @@ -131,7 +136,13 @@ static void app_input_populate_group(app_ui_input_t *input) {
if (!group) {
group = lv_group_get_default();
}
lv_indev_set_group(input->key.indev, group);
lv_indev_set_group(input->wheel.indev, group);
lv_indev_set_group(input->button.indev, group);
if (input->key.indev) {
lv_indev_set_group(input->key.indev, group);
}
if (input->wheel.indev) {
lv_indev_set_group(input->wheel.indev, group);
}
if (input->button.indev) {
lv_indev_set_group(input->button.indev, group);
}
}
Loading