[PATCH weston 07/10] compositor-wayland: Properly clean up on backend destroy

Armin Krezović krezovic.armin at gmail.com
Sun Oct 9 15:30:28 UTC 2016


Also remove a wrong XXX comment.

Signed-off-by: Armin Krezović <krezovic.armin at gmail.com>
---
 libweston/compositor-wayland.c | 21 ++++++++++++++++++++-
 1 file changed, 20 insertions(+), 1 deletion(-)

diff --git a/libweston/compositor-wayland.c b/libweston/compositor-wayland.c
index 133d0c4..0cfc005 100644
--- a/libweston/compositor-wayland.c
+++ b/libweston/compositor-wayland.c
@@ -1244,7 +1244,6 @@ wayland_output_create_for_parent_output(struct wayland_backend *b,
 	output->base.make = poutput->physical.make;
 	output->base.model = poutput->physical.model;
 
-	/* XXX: Clear previously added values */
 	wl_list_init(&output->base.mode_list);
 	wl_list_insert_list(&output->base.mode_list, &poutput->mode_list);
 	wl_list_init(&poutput->mode_list);
@@ -2234,11 +2233,31 @@ wayland_destroy(struct weston_compositor *ec)
 {
 	struct wayland_backend *b = to_wayland_backend(ec);
 
+	wl_event_source_remove(b->parent.wl_source);
+
 	weston_compositor_shutdown(ec);
 
 	if (b->parent.shm)
 		wl_shm_destroy(b->parent.shm);
 
+	if (b->parent.fshell)
+		zwp_fullscreen_shell_v1_release(b->parent.fshell);
+
+	if (b->parent.compositor)
+		wl_compositor_destroy(b->parent.compositor);
+
+	wl_registry_destroy(b->parent.registry);
+	wl_display_flush(b->parent.wl_display);
+	wl_display_disconnect(b->parent.wl_display);
+
+	if (b->theme)
+		theme_destroy(b->theme);
+
+	if (b->frame_device)
+		cairo_device_destroy(b->frame_device);
+
+	wl_cursor_theme_destroy(b->cursor_theme);
+
 	free(b);
 }
 
-- 
2.10.1



More information about the wayland-devel mailing list