compositor-fbdev: always destroy renderer-output on disable
authorPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 13 Sep 2017 14:22:38 +0000 (17:22 +0300)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Wed, 4 Oct 2017 13:18:06 +0000 (16:18 +0300)
If we pass the base->enabled test, then the renderer output is
guaranteed to be there, so we can just destroy it.

Destroying it before unmap makes the sequence match better the enable
path.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
Reviewed-by: Ian Ray <ian.ray@ge.com>
Acked-by Daniel Stone <daniels@collabora.com>

libweston/compositor-fbdev.c

index 01ee18f..8a3ce0d 100644 (file)
@@ -485,11 +485,9 @@ fbdev_output_disable_handler(struct weston_output *base)
        if (!base->enabled)
                return 0;
 
+       pixman_renderer_output_destroy(&output->base);
        fbdev_frame_buffer_unmap(output);
 
-       if (base->renderer_state != NULL)
-               pixman_renderer_output_destroy(base);
-
        return 0;
 }