glx: properly release DRI configs
authorRALOVICH, Kristóf <tade60@freemail.hu>
Thu, 23 Jul 2009 15:04:52 +0000 (17:04 +0200)
committerBrian Paul <brianp@vmware.com>
Tue, 28 Jul 2009 16:35:56 +0000 (10:35 -0600)
Release per screen DRI driver configs during screen destruction.

src/glx/x11/glxext.c

index b296b7c651c67337f3ffee14d7c7677fc56a37a9..3078662c9da28cebe934db354901607774a97cd8 100644 (file)
@@ -149,6 +149,12 @@ FreeScreenConfigs(__GLXdisplayPrivate * priv)
       Xfree((char *) psc->serverGLXexts);
 
 #ifdef GLX_DIRECT_RENDERING
+      if (psc->driver_configs) {
+         for(unsigned int i = 0; psc->driver_configs[i]; i++)
+            free((__DRIconfig*)psc->driver_configs[i]);
+         free(psc->driver_configs);
+         psc->driver_configs = NULL;
+      }
       if (psc->driScreen) {
          psc->driScreen->destroyScreen(psc);
          __glxHashDestroy(psc->drawHash);