Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
xwayland: Destroy xwm on Xwayland ready
If Xwayland is restarted, the ready handler assumes there is no xwm instance.
This means all of xwm is leaked on Xwayland restart. This causes compositors
to consume all cpu resources, where time is spent dispatching. Fix this by
destroying xwm if it exists before creating it.
  • Loading branch information
soreau committed Jun 20, 2020
1 parent 87e7ac6 commit 152b85b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions xwayland/xwayland.c
Expand Up @@ -37,6 +37,9 @@ static void handle_server_ready(struct wl_listener *listener, void *data) {
wl_container_of(listener, xwayland, server_ready);
struct wlr_xwayland_server_ready_event *event = data;

if (xwayland->xwm) {
xwm_destroy(xwayland->xwm);
}
xwayland->xwm = xwm_create(xwayland, event->wm_fd);
if (!xwayland->xwm) {
return;
Expand Down

0 comments on commit 152b85b

Please sign in to comment.