<p dir="ltr">Ander,<br>
I don't neciserally disagree we with this change, but shouldn't the GL renderer clean up after itself better?<br>
--Jason</p>
<div class="gmail_quote">On Dec 20, 2013 1:07 PM, "Ander Conselvan de Oliveira" <<a href="mailto:conselvan2@gmail.com">conselvan2@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
From: Ander Conselvan de Oliveira <<a href="mailto:ander.conselvan.de.oliveira@intel.com">ander.conselvan.de.oliveira@intel.com</a>><br>
<br>
Currently we destroy the renderer before the outputs are destroyed, but<br>
that sometimes leads to an error since a reference to the renderer is<br>
necessary in order to destroy a gl_renderer_output.<br>
<br>
Since destroying the renderer is common among all backends, just move<br>
that call into weston_compositor_shutdown() immediately after the<br>
outputs being destroyed.<br>
---<br>
src/compositor-drm.c | 2 --<br>
src/compositor-fbdev.c | 2 --<br>
src/compositor-headless.c | 2 --<br>
src/compositor-rdp.c | 1 -<br>
src/compositor-rpi.c | 2 --<br>
src/compositor-wayland.c | 2 --<br>
src/compositor-x11.c | 2 --<br>
src/compositor.c | 3 +++<br>
8 files changed, 3 insertions(+), 13 deletions(-)<br>
<br>
diff --git a/src/compositor-drm.c b/src/compositor-drm.c<br>
index f85298a..d637e75 100644<br>
--- a/src/compositor-drm.c<br>
+++ b/src/compositor-drm.c<br>
@@ -2336,8 +2336,6 @@ drm_destroy(struct weston_compositor *ec)<br>
<br>
destroy_sprites(d);<br>
<br>
- ec->renderer->destroy(ec);<br>
-<br>
weston_compositor_shutdown(ec);<br>
<br>
if (d->gbm)<br>
diff --git a/src/compositor-fbdev.c b/src/compositor-fbdev.c<br>
index e649d43..0d96269 100644<br>
--- a/src/compositor-fbdev.c<br>
+++ b/src/compositor-fbdev.c<br>
@@ -797,8 +797,6 @@ fbdev_compositor_destroy(struct weston_compositor *base)<br>
<br>
udev_input_destroy(&compositor->input);<br>
<br>
- compositor->base.renderer->destroy(&compositor->base);<br>
-<br>
/* Destroy the output. */<br>
weston_compositor_shutdown(&compositor->base);<br>
<br>
diff --git a/src/compositor-headless.c b/src/compositor-headless.c<br>
index 5497455..5a5c1e6 100644<br>
--- a/src/compositor-headless.c<br>
+++ b/src/compositor-headless.c<br>
@@ -141,8 +141,6 @@ headless_destroy(struct weston_compositor *ec)<br>
{<br>
struct headless_compositor *c = (struct headless_compositor *) ec;<br>
<br>
- ec->renderer->destroy(ec);<br>
-<br>
weston_seat_release(&c->fake_seat);<br>
weston_compositor_shutdown(ec);<br>
<br>
diff --git a/src/compositor-rdp.c b/src/compositor-rdp.c<br>
index 58342b9..942af50 100644<br>
--- a/src/compositor-rdp.c<br>
+++ b/src/compositor-rdp.c<br>
@@ -521,7 +521,6 @@ rdp_restore(struct weston_compositor *ec)<br>
static void<br>
rdp_destroy(struct weston_compositor *ec)<br>
{<br>
- ec->renderer->destroy(ec);<br>
weston_compositor_shutdown(ec);<br>
<br>
free(ec);<br>
diff --git a/src/compositor-rpi.c b/src/compositor-rpi.c<br>
index 1d52a94..399090d 100644<br>
--- a/src/compositor-rpi.c<br>
+++ b/src/compositor-rpi.c<br>
@@ -422,8 +422,6 @@ rpi_compositor_destroy(struct weston_compositor *base)<br>
<br>
udev_input_destroy(&compositor->input);<br>
<br>
- compositor->base.renderer->destroy(&compositor->base);<br>
-<br>
/* destroys outputs, too */<br>
weston_compositor_shutdown(&compositor->base);<br>
<br>
diff --git a/src/compositor-wayland.c b/src/compositor-wayland.c<br>
index 14ff4af..d2d8942 100644<br>
--- a/src/compositor-wayland.c<br>
+++ b/src/compositor-wayland.c<br>
@@ -1398,8 +1398,6 @@ wayland_destroy(struct weston_compositor *ec)<br>
{<br>
struct wayland_compositor *c = (struct wayland_compositor *) ec;<br>
<br>
- ec->renderer->destroy(ec);<br>
-<br>
weston_compositor_shutdown(ec);<br>
<br>
if (c->parent.shm)<br>
diff --git a/src/compositor-x11.c b/src/compositor-x11.c<br>
index 2ef1b5d..97fe3b1 100644<br>
--- a/src/compositor-x11.c<br>
+++ b/src/compositor-x11.c<br>
@@ -1415,8 +1415,6 @@ x11_destroy(struct weston_compositor *ec)<br>
wl_event_source_remove(compositor->xcb_source);<br>
x11_input_destroy(compositor);<br>
<br>
- ec->renderer->destroy(ec);<br>
-<br>
weston_compositor_shutdown(ec); /* destroys outputs, too */<br>
<br>
XCloseDisplay(compositor->dpy);<br>
diff --git a/src/compositor.c b/src/compositor.c<br>
index ff0f3ab..329ee49 100644<br>
--- a/src/compositor.c<br>
+++ b/src/compositor.c<br>
@@ -3734,6 +3734,9 @@ weston_compositor_shutdown(struct weston_compositor *ec)<br>
wl_list_for_each_safe(output, next, &ec->output_list, link)<br>
output->destroy(output);<br>
<br>
+ if (ec->renderer)<br>
+ ec->renderer->destroy(ec);<br>
+<br>
weston_binding_list_destroy_all(&ec->key_binding_list);<br>
weston_binding_list_destroy_all(&ec->button_binding_list);<br>
weston_binding_list_destroy_all(&ec->touch_binding_list);<br>
--<br>
1.7.9.5<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</blockquote></div>