mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-29 16:05:59 +01:00
xwayland/xwm: don't insert surface in list on error
In case wl_event_loop_add_timer errors out, don't insert the free'd wlr_xwayland_surface in the list. Closes: https://github.com/swaywm/wlroots/issues/1721
This commit is contained in:
parent
9686895b4e
commit
cd4827b3b6
1 changed files with 2 additions and 1 deletions
|
@ -141,7 +141,6 @@ static struct wlr_xwayland_surface *xwayland_surface_create(
|
|||
surface->width = width;
|
||||
surface->height = height;
|
||||
surface->override_redirect = override_redirect;
|
||||
wl_list_insert(&xwm->surfaces, &surface->link);
|
||||
wl_list_init(&surface->children);
|
||||
wl_list_init(&surface->parent_link);
|
||||
wl_signal_init(&surface->events.destroy);
|
||||
|
@ -182,6 +181,8 @@ static struct wlr_xwayland_surface *xwayland_surface_create(
|
|||
return NULL;
|
||||
}
|
||||
|
||||
wl_list_insert(&xwm->surfaces, &surface->link);
|
||||
|
||||
wlr_signal_emit_safe(&xwm->xwayland->events.new_surface, surface);
|
||||
|
||||
return surface;
|
||||
|
|
Loading…
Reference in a new issue