[PATCH? weston] - wayland backend: outputs are destroyed twice

Dawid Gajownik gajownik at gmail.com
Wed Jul 29 16:03:27 PDT 2015


Hi,

in src/compositor-wayland.c:wayland_backend_destroy() you can find this code:

        struct weston_output *output, *next;

        wl_list_for_each_safe(output, next, &b->compositor->output_list, link)
                wayland_output_destroy(output);
[snip]
        weston_compositor_shutdown(b->compositor);

but src/compositor.c:weston_compositor_shutdown() also removes the outputs:

        /* Destroy all outputs associated with this compositor */
        wl_list_for_each_safe(output, next, &ec->output_list, link)
                output->destroy(output);

destroy() is assign in src/compositor-wayland.c:wayland_output_create()

        output->base.destroy = wayland_output_destroy;

Maybe it will be safe to remove unnecessary calls to wayland_output_destroy()?

Thanks,
    Dawid

diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c
index a8e63e1..5c4ad11 100644
--- a/src/compositor-wayland.c
+++ b/src/compositor-wayland.c
@@ -2035,11 +2035,6 @@ err_compositor:
 static void
 wayland_backend_destroy(struct wayland_backend *b)
 {
-       struct weston_output *output, *next;
-
-       wl_list_for_each_safe(output, next, &b->compositor->output_list, link)
-               wayland_output_destroy(output);
-
        b->compositor->renderer->destroy(b->compositor);
        wl_display_disconnect(b->parent.wl_display);


More information about the wayland-devel mailing list