summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-02-05 11:27:55 +0800
committerChia-I Wu <[email protected]>2010-02-05 11:45:01 +0800
commitfc5ca85a63c6d252a9e8c450f12d2f11057ea2c6 (patch)
treeb36a77eeeef62fd3d5d9785f53e3ee3cc38007df /src
parent7e7c1ba40b6e10b7d38490e7f3252dbebb3a3a72 (diff)
egl_dri2: Do not destroy linked resources.
A linked resource is stil owned by the display.
Diffstat (limited to 'src')
-rw-r--r--src/egl/drivers/dri2/egl_dri2.c6
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 84dd958490e..3bdac2944cb 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;