X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fglx%2Fapplegl_glx.c;h=9be12b0f6b26fba1c3b1fd53828c01f096c2e8e8;hb=dd32df3829317105adbfacc7fe7b1d2a2dc96a58;hp=8766c88a136ac1ddab7af5c6bed8645a31dc4fca;hpb=559e4f8ebcb186b491d7d687ac43f22a62448fc1;p=mesa.git diff --git a/src/glx/applegl_glx.c b/src/glx/applegl_glx.c index 8766c88a136..9be12b0f6b2 100644 --- a/src/glx/applegl_glx.c +++ b/src/glx/applegl_glx.c @@ -69,6 +69,24 @@ applegl_bind_context(struct glx_context *gc, struct glx_context *old, static void applegl_unbind_context(struct glx_context *gc, struct glx_context *new) { + Display *dpy; + bool error; + + /* If we don't have a context, then we have nothing to unbind */ + if (!gc) + return; + + /* If we have a new context, keep this one around and remove it during bind. */ + if (new) + return; + + dpy = gc->psc->dpy; + + error = apple_glx_make_current_context(dpy, + (gc != &dummyContext) ? gc->driContext : NULL, + NULL, None); + + apple_glx_diagnostic("%s: error %s\n", __func__, error ? "YES" : "NO"); } static void