Hi, this patch calls corresponding destroyContext in egl_dri2 and egl_glx driver.<br>Any comment?<br><br>Cooper<br><br>---<br> src/egl/drivers/dri2/egl_dri2.c |   17 +++++++++++++++++<br> src/egl/drivers/glx/egl_glx.c   |   18 ++++++++++++++++++<br>

 2 files changed, 35 insertions(+), 0 deletions(-)<br><br>diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c<br>
index 9a37ea4..2d947cd 100644<br>--- a/src/egl/drivers/dri2/egl_dri2.c<br>+++ b/src/egl/drivers/dri2/egl_dri2.c<br>@@ -726,6 +726,22 @@ dri2_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,<br> }<br> <br>


 /**<br>+ * Called via eglDestroyContext(), drv-&gt;API.DestroyContext().<br>+ */<br>+static EGLBoolean<br>+dri2_destroy_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx)<br>+{<br>+   struct dri2_egl_context *dri2_ctx = dri2_egl_context(ctx);<br>


+   struct dri2_egl_display *dri2_dpy = dri2_egl_display(disp);<br>+<br>+   _eglPutContext(ctx);<br>+   dri2_dpy-&gt;core-&gt;destroyContext(dri2_ctx-&gt;dri_context);<br>+   free(dri2_ctx);<br>+<br>+   return EGL_TRUE;<br>


+}<br>+<br>+/**<br>  * Called via eglMakeCurrent(), drv-&gt;API.MakeCurrent().<br>  */<br> static EGLBoolean<br>@@ -1348,6 +1364,7 @@ _EGL_MAIN(const char *args)<br>    dri2_drv-&gt;base.API.Initialize = dri2_initialize;<br>


    dri2_drv-&gt;base.API.Terminate = dri2_terminate;<br>    dri2_drv-&gt;base.API.CreateContext = dri2_create_context;<br>+   dri2_drv-&gt;base.API.DestroyContext = dri2_destroy_context;<br>    dri2_drv-&gt;base.API.MakeCurrent = dri2_make_current;<br>


    dri2_drv-&gt;base.API.GetProcAddress = dri2_get_proc_address;<br>    dri2_drv-&gt;base.API.WaitClient = dri2_wait_client;<br>diff --git a/src/egl/drivers/glx/egl_glx.c b/src/egl/drivers/glx/egl_glx.c<br>index 7cf8f4d..b21a3d7 100644<br>


--- a/src/egl/drivers/glx/egl_glx.c<br>+++ b/src/egl/drivers/glx/egl_glx.c<br>@@ -713,6 +713,23 @@ GLX_eglCreateContext(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,<br>    return &amp;GLX_ctx-&gt;Base;<br> }<br>

 <br>
+/**<br>+ * Called via eglDestroyContext(), drv-&gt;API.DestroyContext().<br>+ */<br>+static EGLBoolean<br>+GLX_eglDestroyContext(_EGLDriver *drv, _EGLDisplay *disp, _EGLContext *ctx)<br>+{<br>+   struct GLX_egl_driver *GLX_drv = GLX_egl_driver(drv);<br>


+   struct GLX_egl_context *GLX_ctx = GLX_egl_context(ctx);<br>+<br>+   _eglPutContext(ctx);<br>+   assert(GLX_ctx);<br>+   GLX_drv-&gt;glXDestroyContext(disp, ctx);<br>+<br>+   free(GLX_ctx);<br>+<br>+   return EGL_TRUE;<br>


+}<br> <br> /**<br>  * Destroy a surface.  The display is allowed to be uninitialized.<br>@@ -1142,6 +1159,7 @@ _EGL_MAIN(const char *args)<br>    GLX_drv-&gt;Base.API.Initialize = GLX_eglInitialize;<br>    GLX_drv-&gt;Base.API.Terminate = GLX_eglTerminate;<br>


    GLX_drv-&gt;Base.API.CreateContext = GLX_eglCreateContext;<br>+   GLX_drv-&gt;Base.API.DestroyContext = GLX_eglDestroyContext;<br>    GLX_drv-&gt;Base.API.MakeCurrent = GLX_eglMakeCurrent;<br>    GLX_drv-&gt;Base.API.CreateWindowSurface = GLX_eglCreateWindowSurface;<br>


    GLX_drv-&gt;Base.API.CreatePixmapSurface = GLX_eglCreatePixmapSurface;<br>-- <br>1.7.4.4<br><br><br>