we may still get events from x, so  by setting those fields to NULL
we make sure we don't try to use destroyed objects.
---
 src/xwayland/window-manager.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index e1f26f6..912553e 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -1878,6 +1878,9 @@ surface_destroy(struct wl_listener *listener, void *data)
                container_of(listener,
                             struct weston_wm_window, surface_destroy_listener);
 
+       window->surface = NULL;
+       /* This should have been freed by the shell */
+       window->shsurf = NULL;
        wm_log("surface for xid %d destroyed\n", window->id);
 
        window->surface = NULL;
-- 
1.8.4

_______________________________________________
wayland-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/wayland-devel

Reply via email to