egl/wayland: polish object teardown in dri2_wl_destroy_surface
authorEmil Velikov <emil.velikov@collabora.com>
Sun, 27 Aug 2017 10:20:28 +0000 (11:20 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Tue, 29 Aug 2017 12:41:06 +0000 (13:41 +0100)
The wl_drm wrapper is created before the wl display/surface ones.
Thus make sure we destroy it after them. In reality it should not make
any difference either way.

Fixes: 03dd9a88b0b ("egl/wayland: Use per-surface event queues")
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
src/egl/drivers/dri2/platform_wayland.c

index 05263fe99da495ef8d7d848424a042f68e1f2d41..754ce6c3990f03fe71ccf548e7a8de16f31b35a9 100644 (file)
@@ -293,10 +293,10 @@ dri2_wl_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
       dri2_surf->wl_win->destroy_window_callback = NULL;
    }
 
-   if (dri2_surf->wl_drm_wrapper)
-      wl_proxy_wrapper_destroy(dri2_surf->wl_drm_wrapper);
    wl_proxy_wrapper_destroy(dri2_surf->wl_surface_wrapper);
    wl_proxy_wrapper_destroy(dri2_surf->wl_dpy_wrapper);
+   if (dri2_surf->wl_drm_wrapper)
+      wl_proxy_wrapper_destroy(dri2_surf->wl_drm_wrapper);
    wl_event_queue_destroy(dri2_surf->wl_queue);
 
    free(surf);