diff options
author | Kristian Høgsberg <[email protected]> | 2010-07-22 23:45:18 -0400 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2010-07-23 22:05:52 -0400 |
commit | c796bb0cc3fde409545bff320540ddf5c029e513 (patch) | |
tree | dded830c438042a6d7a97a260d33b27f49737271 /src/glx/glxcurrent.c | |
parent | 80b331c7f6c3724f2044325e0d7d7c79ae5a4510 (diff) |
glx: Move context destroy to context vtable
Diffstat (limited to 'src/glx/glxcurrent.c')
-rw-r--r-- | src/glx/glxcurrent.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/src/glx/glxcurrent.c b/src/glx/glxcurrent.c index 0bf61779c4a..e8649b67655 100644 --- a/src/glx/glxcurrent.c +++ b/src/glx/glxcurrent.c @@ -468,32 +468,13 @@ MakeContextCurrent(Display * dpy, GLXDrawable draw, oldGC->currentReadable = None; oldGC->currentContextTag = 0; oldGC->thread_id = 0; -#ifdef GLX_USE_APPLEGL - - /* - * At this point we should check if the context has been - * through glXDestroyContext, and redestroy it if so. - */ - if(oldGC->do_destroy) { - __glXUnlock(); - /* glXDestroyContext uses the same global lock. */ - glXDestroyContext(dpy, oldGC); - __glXLock(); -#else + if (oldGC->xid == None) { /* We are switching away from a context that was * previously destroyed, so we need to free the memory * for the old handle. */ -#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL) - /* Destroy the old direct rendering context */ - if (oldGC->driContext) { - oldGC->driContext->destroyContext(oldGC); - oldGC->driContext = NULL; - } -#endif - __glXFreeContext(oldGC); -#endif /* GLX_USE_APPLEGL */ + oldGC->vtable->destroy(oldGC); } } if (gc) { |