]> git.mdlowis.com Git - proto/labwc.git/commitdiff
xwayland: clear wlr_xwayland_surface in handle_destroy
authorJohan Malm <jgm323@gmail.com>
Wed, 20 Oct 2021 19:34:47 +0000 (20:34 +0100)
committerJohan Malm <jgm323@gmail.com>
Wed, 20 Oct 2021 19:34:47 +0000 (20:34 +0100)
Avoids wlr_xwayland_surface becoming a dangling pointer if a view is not
destroyed immediately.

See swaywm/sway@215787e8

src/xwayland.c

index 8d40185310cf2de472bee3115eade02649d41801..3f64061ee22299877128729a31c8cecd4e3032b8 100644 (file)
@@ -81,6 +81,7 @@ handle_destroy(struct wl_listener *listener, void *data)
        if (view->toplevel_handle) {
                wlr_foreign_toplevel_handle_v1_destroy(view->toplevel_handle);
        }
+       view->xwayland_surface = NULL;
        wl_list_remove(&view->link);
        wl_list_remove(&view->map.link);
        wl_list_remove(&view->unmap.link);
@@ -97,7 +98,7 @@ handle_request_configure(struct wl_listener *listener, void *data)
 {
        struct view *view = wl_container_of(listener, view, request_configure);
        struct wlr_xwayland_surface_configure_event *event = data;
-       
+
        int min_width, min_height;
        view_min_size(view, &min_width, &min_height);