diff options
author | Brian <brian@yutani.localnet.net> | 2007-02-01 07:22:50 -0700 |
---|---|---|
committer | Brian <brian@yutani.localnet.net> | 2007-02-01 07:22:50 -0700 |
commit | af1d1e08e40c8c70dfa81e39724be11da94f938d (patch) | |
tree | 91ac4c2705691ea80359d1664de29a4e14ddcf55 /src/glx/x11 | |
parent | 0930248bb1336064337e636aab0f17ee0f8f7043 (diff) | |
parent | 8628b382e4ac492d829fe720219187b758add003 (diff) |
Merge branch 'master' of git+ssh://brianp@git.freedesktop.org/git/mesa/mesa
Diffstat (limited to 'src/glx/x11')
-rw-r--r-- | src/glx/x11/dri_glx.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/src/glx/x11/dri_glx.c b/src/glx/x11/dri_glx.c index 0875361d0b..6f944d7d60 100644 --- a/src/glx/x11/dri_glx.c +++ b/src/glx/x11/dri_glx.c @@ -376,7 +376,7 @@ const char *glXGetDriverConfig (const char *driverName) { } -/* This function isn't currently used. +/* Called from __glXFreeDisplayPrivate. */ static void driDestroyDisplay(Display *dpy, void *private) { @@ -386,8 +386,24 @@ static void driDestroyDisplay(Display *dpy, void *private) const int numScreens = ScreenCount(dpy); int i; for (i = 0; i < numScreens; i++) { - if (pdpyp->libraryHandles[i]) - dlclose(pdpyp->libraryHandles[i]); + if (pdpyp->libraryHandles[i]) { + __DRIdriver *driver, *prev; + + /* Remove driver from Drivers list */ + for (prev = NULL, driver = Drivers; driver; + prev = driver, driver = driver->next) { + if (driver->handle == pdpyp->libraryHandles[i]) { + if (prev) + prev->next = driver->next; + else + Drivers = driver->next; + + Xfree(driver); + } + } + + dlclose(pdpyp->libraryHandles[i]); + } } Xfree(pdpyp->libraryHandles); Xfree(pdpyp); |