summaryrefslogtreecommitdiff
path: root/glx/glxdriswrast.c
diff options
context:
space:
mode:
Diffstat (limited to 'glx/glxdriswrast.c')
-rw-r--r--glx/glxdriswrast.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/glx/glxdriswrast.c b/glx/glxdriswrast.c
index ed142c167..d064a0536 100644
--- a/glx/glxdriswrast.c
+++ b/glx/glxdriswrast.c
@@ -74,6 +74,7 @@ struct __GLXDRIscreen {
const __DRIswrastExtension *swrast;
const __DRIcopySubBufferExtension *copySubBuffer;
const __DRItexBufferExtension *texBuffer;
+ const __DRIconfig **driConfigs;
};
struct __GLXDRIcontext {
@@ -240,6 +241,8 @@ static __GLXtextureFromPixmap __glXDRItextureFromPixmap = {
static void
__glXDRIscreenDestroy(__GLXscreen *baseScreen)
{
+ int i;
+
__GLXDRIscreen *screen = (__GLXDRIscreen *) baseScreen;
(*screen->core->destroyScreen)(screen->driScreen);
@@ -248,6 +251,12 @@ __glXDRIscreenDestroy(__GLXscreen *baseScreen)
__glXScreenDestroy(baseScreen);
+ if (screen->driConfigs) {
+ for (i = 0; screen->driConfigs[i] != NULL; i++)
+ free((__DRIconfig **)screen->driConfigs[i]);
+ free(screen->driConfigs);
+ }
+
free(screen);
}
@@ -426,7 +435,6 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
{
const char *driverName = "swrast";
__GLXDRIscreen *screen;
- const __DRIconfig **driConfigs;
screen = calloc(1, sizeof *screen);
if (screen == NULL)
@@ -450,7 +458,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
screen->driScreen =
(*screen->swrast->createNewScreen)(pScreen->myNum,
loader_extensions,
- &driConfigs,
+ &screen->driConfigs,
screen);
if (screen->driScreen == NULL) {
@@ -461,7 +469,7 @@ __glXDRIscreenProbe(ScreenPtr pScreen)
initializeExtensions(screen);
- screen->base.fbconfigs = glxConvertConfigs(screen->core, driConfigs,
+ screen->base.fbconfigs = glxConvertConfigs(screen->core, screen->driConfigs,
GLX_WINDOW_BIT |
GLX_PIXMAP_BIT |
GLX_PBUFFER_BIT);