[PATCH 02/10] compositor: Remove output from list in weston_output_destroy()

Ander Conselvan de Oliveira conselvan2 at gmail.com
Fri Dec 13 12:10:50 PST 2013


From: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira at intel.com>

When destroying ouputs, they would sometimes be removed before the call
to weston_output_destory() and sometimes after, depending on the
backend. Now the output is remove withing that function so the behavior
is standard across all backends.
---
 src/compositor-drm.c   |    1 -
 src/compositor-fbdev.c |    1 -
 src/compositor-rpi.c   |    1 -
 src/compositor-x11.c   |    1 -
 src/compositor.c       |    2 ++
 5 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/compositor-drm.c b/src/compositor-drm.c
index fbf6e49..44deaab 100644
--- a/src/compositor-drm.c
+++ b/src/compositor-drm.c
@@ -1146,7 +1146,6 @@ drm_output_destroy(struct weston_output *output_base)
 	weston_plane_release(&output->cursor_plane);
 
 	weston_output_destroy(&output->base);
-	wl_list_remove(&output->base.link);
 
 	free(output);
 }
diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c
index 09f165b..e649d43 100644
--- a/src/compositor-fbdev.c
+++ b/src/compositor-fbdev.c
@@ -692,7 +692,6 @@ fbdev_output_destroy(struct weston_output *base)
 	}
 
 	/* Remove the output. */
-	wl_list_remove(&output->base.link);
 	weston_output_destroy(&output->base);
 
 	free(output);
diff --git a/src/compositor-rpi.c b/src/compositor-rpi.c
index 88ea8e0..1d52a94 100644
--- a/src/compositor-rpi.c
+++ b/src/compositor-rpi.c
@@ -278,7 +278,6 @@ rpi_output_destroy(struct weston_output *base)
 	 */
 	rpi_flippipe_release(&output->flippipe);
 
-	wl_list_remove(&output->base.link);
 	weston_output_destroy(&output->base);
 
 	vc_dispmanx_display_close(output->display);
diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index 6e507f9..9a36b59 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -483,7 +483,6 @@ x11_output_destroy(struct weston_output *output_base)
 	struct x11_compositor *compositor =
 		(struct x11_compositor *)output->base.compositor;
 
-	wl_list_remove(&output->base.link);
 	wl_event_source_remove(output->finish_frame_timer);
 
 	if (compositor->use_pixman) {
diff --git a/src/compositor.c b/src/compositor.c
index 8f4bdef..0e739e3 100644
--- a/src/compositor.c
+++ b/src/compositor.c
@@ -2996,6 +2996,8 @@ bind_output(struct wl_client *client,
 WL_EXPORT void
 weston_output_destroy(struct weston_output *output)
 {
+	wl_list_remove(&output->link);
+
 	wl_signal_emit(&output->destroy_signal, output);
 
 	free(output->name);
-- 
1.7.9.5



More information about the wayland-devel mailing list