[PATCH weston] gl-renderer: Set renderer to NULL after destroyed

Dawid Gajownik gajownik at gmail.com
Tue Aug 11 06:31:09 PDT 2015


On Tue, Aug 11, 2015 at 4:09 AM, Ucan, Emre (ADITG/SW1)
<eucan at de.adit-jv.com> wrote:
> The pointer of the renderer in the compositor data structure is controlled
> in weston_compositor_shutdown. When it is not NULL, the destroy method of
> the renderer is called. Therefore, the renderer pointer should be set to NULL
> in gl_renderer_destroy, so that it would not be called when it is already destroyed.

Hey,

when it's destroyed twice? In X11 backend in x11_backend_create()?
Maybe we should not call renderer->destroy(compositor) directly but
use weston_compositor_shutdown(compositor)?

diff --git a/src/compositor-x11.c b/src/compositor-x11.c
index 73ba783..5a7394a 100644
--- a/src/compositor-x11.c
+++ b/src/compositor-x11.c
@@ -1671,7 +1671,7 @@ x11_backend_create(struct weston_compositor *compositor,
 err_x11_input:
        x11_input_destroy(b);
 err_renderer:
-       compositor->renderer->destroy(compositor);
+       weston_compositor_shutdown(compositor);
 err_xdisplay:
        XCloseDisplay(b->dpy);
 err_free:

Or did you find another case when renderer is already destroyed?

Thanks,
  Dawid


More information about the wayland-devel mailing list