Mesa (master): egl_dri2: Do not destroy linked resources.

Chia-I Wu olv at kemper.freedesktop.org
Fri Feb 5 03:45:14 UTC 2010


Module: Mesa
Branch: master
Commit: fc5ca85a63c6d252a9e8c450f12d2f11057ea2c6
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fc5ca85a63c6d252a9e8c450f12d2f11057ea2c6

Author: Chia-I Wu <olvaffe at gmail.com>
Date:   Fri Feb  5 11:27:55 2010 +0800

egl_dri2: Do not destroy linked resources.

A linked resource is stil owned by the display.

---

 src/egl/drivers/dri2/egl_dri2.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
index 84dd958..3bdac29 100644
--- a/src/egl/drivers/dri2/egl_dri2.c
+++ b/src/egl/drivers/dri2/egl_dri2.c
@@ -735,11 +735,11 @@ dri2_make_current(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *dsurf,
 
    if ((cctx == NULL && ddraw == NULL && rdraw == NULL) ||
        dri2_dpy->core->bindContext(cctx, ddraw, rdraw)) {
-      if (dsurf)
+      if (dsurf && !_eglIsSurfaceLinked(dsurf))
 	 dri2_destroy_surface(drv, disp, dsurf);
-      if (rsurf && rsurf != dsurf)
+      if (rsurf && rsurf != dsurf && !_eglIsSurfaceLinked(dsurf))
 	 dri2_destroy_surface(drv, disp, rsurf);
-      if (ctx != NULL)
+      if (ctx != NULL && !_eglIsContextLinked(ctx))
 	 dri2_dpy->core->unbindContext(dri2_egl_context(ctx)->dri_context);
 
       return EGL_TRUE;




More information about the mesa-commit mailing list