[Mesa-dev] [PATCH 09/30] egl/dri2: drop NULL checks prior to dri2_destroy_surface

Emil Velikov emil.l.velikov at gmail.com
Thu Aug 25 16:18:31 UTC 2016


From: Emil Velikov <emil.velikov at collabora.com>

The function already have the respective check within.

Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
---
 src/egl/drivers/dri2/egl_dri2.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 89d2966..a481236 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -1279,10 +1279,8 @@ dri2_make_current(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
    unbind = (cctx == NULL && ddraw == NULL && rdraw == NULL);
 
    if (unbind || dri2_dpy->core->bindContext(cctx, ddraw, rdraw)) {
-      if (old_dsurf)
-         dri2_destroy_surface(drv, disp, old_dsurf);
-      if (old_rsurf)
-         dri2_destroy_surface(drv, disp, old_rsurf);
+      dri2_destroy_surface(drv, disp, old_dsurf);
+      dri2_destroy_surface(drv, disp, old_rsurf);
 
       if (!unbind)
          dri2_dpy->ref_count++;
-- 
2.9.0



More information about the mesa-dev mailing list