compositor: Remove output from list in weston_output_destroy()
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Fri, 13 Dec 2013 20:10:50 +0000 (22:10 +0200)
committerKristian Høgsberg <krh@bitplanet.net>
Tue, 17 Dec 2013 00:19:46 +0000 (16:19 -0800)
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
src/compositor-fbdev.c
src/compositor-rpi.c
src/compositor-x11.c
src/compositor.c

index fbf6e49..44deaab 100644 (file)
@@ -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);
 }
index 09f165b..e649d43 100644 (file)
@@ -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);
index 88ea8e0..1d52a94 100644 (file)
@@ -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);
index 6e507f9..9a36b59 100644 (file)
@@ -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) {
index 8f4bdef..0e739e3 100644 (file)
@@ -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);