egl/wayland: remove non-applicable destroyDrawable from error path
authorEmil Velikov <emil.velikov@collabora.com>
Fri, 11 Nov 2016 16:45:00 +0000 (16:45 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 21 Nov 2016 14:46:40 +0000 (14:46 +0000)
If we fail to create the drawable there's not much point in attampting
to destroy it.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
src/egl/drivers/dri2/platform_wayland.c

index 4fd4289679eb33f838dc1acb8e4fd7cc68344da3..395f1e181d3da1abf7764dfadd92fa4bdb644104 100644 (file)
@@ -1752,7 +1752,7 @@ dri2_wl_swrast_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
                                              config, dri2_surf);
    if (dri2_surf->dri_drawable == NULL) {
       _eglError(EGL_BAD_ALLOC, "swrast->createNewDrawable");
-      goto cleanup_dri_drawable;
+      goto cleanup_surf;
    }
 
    dri2_wl_swap_interval(drv, disp, &dri2_surf->base,
@@ -1760,8 +1760,6 @@ dri2_wl_swrast_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
 
    return &dri2_surf->base;
 
- cleanup_dri_drawable:
-   dri2_dpy->core->destroyDrawable(dri2_surf->dri_drawable);
  cleanup_surf:
    free(dri2_surf);