compositor: Destroy renderer in weston_compositor_shutdown()

Currently we destroy the renderer before the outputs are destroyed, but
that sometimes leads to an error since a reference to the renderer is
necessary in order to destroy a gl_renderer_output.

Since destroying the renderer is common among all backends, just move
that call into weston_compositor_shutdown() immediately after the
outputs being destroyed.
This commit is contained in:
Ander Conselvan de Oliveira 2013-12-20 21:07:00 +02:00 committed by Kristian Høgsberg
parent ddc2b1ec32
commit 18536764b4
8 changed files with 3 additions and 13 deletions

View File

@ -2336,8 +2336,6 @@ drm_destroy(struct weston_compositor *ec)
destroy_sprites(d);
ec->renderer->destroy(ec);
weston_compositor_shutdown(ec);
if (d->gbm)

View File

@ -797,8 +797,6 @@ fbdev_compositor_destroy(struct weston_compositor *base)
udev_input_destroy(&compositor->input);
compositor->base.renderer->destroy(&compositor->base);
/* Destroy the output. */
weston_compositor_shutdown(&compositor->base);

View File

@ -141,8 +141,6 @@ headless_destroy(struct weston_compositor *ec)
{
struct headless_compositor *c = (struct headless_compositor *) ec;
ec->renderer->destroy(ec);
weston_seat_release(&c->fake_seat);
weston_compositor_shutdown(ec);

View File

@ -521,7 +521,6 @@ rdp_restore(struct weston_compositor *ec)
static void
rdp_destroy(struct weston_compositor *ec)
{
ec->renderer->destroy(ec);
weston_compositor_shutdown(ec);
free(ec);

View File

@ -422,8 +422,6 @@ rpi_compositor_destroy(struct weston_compositor *base)
udev_input_destroy(&compositor->input);
compositor->base.renderer->destroy(&compositor->base);
/* destroys outputs, too */
weston_compositor_shutdown(&compositor->base);

View File

@ -1398,8 +1398,6 @@ wayland_destroy(struct weston_compositor *ec)
{
struct wayland_compositor *c = (struct wayland_compositor *) ec;
ec->renderer->destroy(ec);
weston_compositor_shutdown(ec);
if (c->parent.shm)

View File

@ -1419,8 +1419,6 @@ x11_destroy(struct weston_compositor *ec)
wl_event_source_remove(compositor->xcb_source);
x11_input_destroy(compositor);
ec->renderer->destroy(ec);
weston_compositor_shutdown(ec); /* destroys outputs, too */
XCloseDisplay(compositor->dpy);

View File

@ -3734,6 +3734,9 @@ weston_compositor_shutdown(struct weston_compositor *ec)
wl_list_for_each_safe(output, next, &ec->output_list, link)
output->destroy(output);
if (ec->renderer)
ec->renderer->destroy(ec);
weston_binding_list_destroy_all(&ec->key_binding_list);
weston_binding_list_destroy_all(&ec->button_binding_list);
weston_binding_list_destroy_all(&ec->touch_binding_list);