compositor: don't crash if destroying a compositor without a backend

Calling weston_compositor_destroy() on a pointer returned by
weston_compositor_create() should be always valid, even if the
compositor does not have yet a backend.

Signed-off-by: Giulio Camuffo <giuliocamuffo@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
dev
Giulio Camuffo 9 years ago committed by Derek Foreman
parent 7e17fec68d
commit 2d24e64776
  1. 3
      src/compositor.c

@ -4767,7 +4767,8 @@ weston_compositor_destroy(struct weston_compositor *compositor)
weston_compositor_xkb_destroy(compositor);
compositor->backend->destroy(compositor);
if (compositor->backend)
compositor->backend->destroy(compositor);
free(compositor);
}

Loading…
Cancel
Save