Skip to content

Commit

Permalink
rootston: don't crash on shutdown
Browse files Browse the repository at this point in the history
When e.g. running rootston under X11 it would otherwise crash when
closing rootston like:

    #0  0x00007f0197da7327 in wl_list_remove () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    swaywm#1  0x000056306fcee7fb in handle_destroy (listener=0x5630723a2948, data=0x5630723a5d20) at ../rootston/layer_shell.c:273
    swaywm#2  0x00007f019800a552 in wlr_signal_emit_safe (signal=0x5630723a5e30, data=0x5630723a5d20) at ../util/signal.c:29
    swaywm#3  0x00007f0197fef808 in layer_surface_destroy (surface=0x5630723a5d20) at ../types/wlr_layer_shell.c:169
    swaywm#4  0x00007f0197ff0001 in client_handle_destroy (resource=0x56307229c4c0) at ../types/wlr_layer_shell.c:371
    swaywm#5  0x00007f0197da2f30 in  () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    swaywm#6  0x00007f0197da77f9 in  () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    swaywm#7  0x00007f0197da301d in wl_client_destroy () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    swaywm#8  0x00007f0197da30d8 in  () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    swaywm#9  0x00007f0197da4c12 in wl_event_loop_dispatch () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    swaywm#10 0x00007f0197da344a in wl_display_run () at /usr/lib/x86_64-linux-gnu/libwayland-server.so.0
    swaywm#11 0x000056306fcef069 in main (argc=3, argv=0x7ffd22032528) at ../rootston/main.c:83

since the output_destroy got already removed in handle_output_destroy.
  • Loading branch information
agx committed Apr 16, 2018
1 parent 72411a7 commit 47e1eda
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions rootston/layer_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,10 @@ static void handle_destroy(struct wl_listener *listener, void *data) {
wl_list_remove(&layer->map.link);
wl_list_remove(&layer->unmap.link);
wl_list_remove(&layer->surface_commit.link);
wl_list_remove(&layer->output_destroy.link);
arrange_layers((struct roots_output *)layer->layer_surface->output->data);
if (layer->layer_surface->output) {
wl_list_remove(&layer->output_destroy.link);
arrange_layers((struct roots_output *)layer->layer_surface->output->data);
}
free(layer);
}

Expand Down

0 comments on commit 47e1eda

Please sign in to comment.