[PATCH weston] xwm: remove the destroy listener from the old surface signal

Giulio Camuffo giuliocamuffo at gmail.com
Fri Sep 20 07:16:06 PDT 2013


---
 src/xwayland/window-manager.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/xwayland/window-manager.c b/src/xwayland/window-manager.c
index 3b88dac..9f0899d 100644
--- a/src/xwayland/window-manager.c
+++ b/src/xwayland/window-manager.c
@@ -2087,6 +2087,12 @@ xserver_set_window_id(struct wl_client *client, struct wl_resource *resource,
 
 	weston_wm_window_read_properties(window);
 
+	/* A weston_wm_window may have many different surfaces assigned
+	 * throughout its life, so we must make sure to remove the listener
+	 * from the old surface signal list. */
+	if (window->surface)
+		wl_list_remove(&window->surface_destroy_listener.link);
+
 	window->surface = (struct weston_surface *) surface;
 	window->surface_destroy_listener.notify = surface_destroy;
 	wl_signal_add(&surface->destroy_signal,
-- 
1.8.4



More information about the wayland-devel mailing list