gl_drm: Fix silly run time warning for wayland dmabuf

DMABuf buffers destroy their glimage in the unbind callback, so it's
usually already gone for the free callback.

Now we test if we actually need to destroy anything.

Also, switch to GLERRV macro for error reporting - it saves us the heavy
eglGetError() unless we've built it in intentionally.
This commit is contained in:
Derek Foreman 2016-05-20 15:23:19 -05:00
parent ba06327527
commit f8976aed13
1 changed files with 2 additions and 5 deletions

View File

@ -750,14 +750,11 @@ _native_cb_free(void *image)
eina_hash_del(img->native.shared->native_wl_hash, &wlid, img);
if (n->ns_data.wl_surface.surface)
{
if (glsym_eglDestroyImage)
if (glsym_eglDestroyImage && n->ns_data.wl_surface_dmabuf.image)
{
glsym_eglDestroyImage(img->native.disp, n->ns_data.wl_surface_dmabuf.image);
if (eglGetError() != EGL_SUCCESS)
ERR("eglDestroyImage() failed.");
GLERRV("eglDestroyImage() failed.");
}
else
ERR("Try eglDestroyImage on EGL with no support");
}
}
else if (n->ns.type == EVAS_NATIVE_SURFACE_WL)