Skip to content

Commit

Permalink
[Wayland] Clear frame_cb after destroying resources
Browse files Browse the repository at this point in the history
  • Loading branch information
alebastr authored and lbonn committed Jan 8, 2024
1 parent 5bc2f09 commit 1592525
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion source/wayland/display.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,7 @@ static void wayland_frame_callback(void *data, struct wl_callback *callback,
uint32_t timestamp) {
if (wayland->frame_cb != NULL) {
wl_callback_destroy(wayland->frame_cb);
wayland->frame_cb = NULL;
rofi_view_frame_callback();
}
if (wayland->surface != NULL) {
Expand Down Expand Up @@ -651,6 +652,7 @@ static void wayland_pointer_leave(void *data, struct wl_pointer *pointer,

if (wayland->cursor.frame_cb != NULL) {
wl_callback_destroy(wayland->cursor.frame_cb);
wayland->cursor.frame_cb = NULL;
}
}

Expand Down Expand Up @@ -1225,8 +1227,8 @@ static void wayland_registry_handle_global_remove(void *data,
((wayland->compositor == NULL) || (wayland->shm == NULL))) {
if (wayland->cursor.frame_cb != NULL) {
wl_callback_destroy(wayland->cursor.frame_cb);
wayland->cursor.frame_cb = NULL;
}
wayland->cursor.frame_cb = NULL;

wl_surface_destroy(wayland->cursor.surface);
wl_cursor_theme_destroy(wayland->cursor.theme);
Expand Down

0 comments on commit 1592525

Please sign in to comment.