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:
parent
ddc2b1ec32
commit
18536764b4
@ -2336,8 +2336,6 @@ drm_destroy(struct weston_compositor *ec)
|
||||
|
||||
destroy_sprites(d);
|
||||
|
||||
ec->renderer->destroy(ec);
|
||||
|
||||
weston_compositor_shutdown(ec);
|
||||
|
||||
if (d->gbm)
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user