diff --git a/cogl/winsys/cogl-winsys-egl-wayland.c b/cogl/winsys/cogl-winsys-egl-wayland.c index d97f9ec25..628c348d5 100644 --- a/cogl/winsys/cogl-winsys-egl-wayland.c +++ b/cogl/winsys/cogl-winsys-egl-wayland.c @@ -114,6 +114,9 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer) CoglRendererEGL *egl_renderer = renderer->winsys; CoglRendererWayland *wayland_renderer = egl_renderer->platform; + if (egl_renderer->edpy) + eglTerminate (egl_renderer->edpy); + if (wayland_renderer->wayland_display) { _cogl_poll_renderer_remove_fd (renderer, wayland_renderer->fd); @@ -122,9 +125,6 @@ _cogl_winsys_renderer_disconnect (CoglRenderer *renderer) wl_display_disconnect (wayland_renderer->wayland_display); } - if (egl_renderer->edpy) - eglTerminate (egl_renderer->edpy); - g_slice_free (CoglRendererWayland, egl_renderer->platform); g_slice_free (CoglRendererEGL, egl_renderer); }