aboutsummaryrefslogtreecommitdiffstats
path: root/src/egl/main/egldisplay.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/egl/main/egldisplay.c')
-rw-r--r--src/egl/main/egldisplay.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/egl/main/egldisplay.c b/src/egl/main/egldisplay.c
index 359900ca2f2..125909d2bc9 100644
--- a/src/egl/main/egldisplay.c
+++ b/src/egl/main/egldisplay.c
@@ -242,7 +242,10 @@ _eglCheckResource(void *res, _EGLResourceType type, _EGLDisplay *dpy)
void
_eglLinkResource(_EGLResource *res, _EGLResourceType type, _EGLDisplay *dpy)
{
+ assert(!res->Display || res->Display == dpy);
+
res->Display = dpy;
+ res->IsLinked = EGL_TRUE;
res->Next = dpy->ResourceLists[type];
dpy->ResourceLists[type] = res;
}
@@ -271,5 +274,6 @@ _eglUnlinkResource(_EGLResource *res, _EGLResourceType type)
}
res->Next = NULL;
- res->Display = NULL;
+ /* do not reset res->Display */
+ res->IsLinked = EGL_FALSE;
}