summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-01-04 12:24:48 -0800
committerKeith Packard <keithp@neko.keithp.com>2007-01-29 22:56:31 -0800
commitcd5fe7890d9b940b9d3e00043a6c81a10ae3db69 (patch)
tree3f2ad710d000e65240f755d4b7626660e4e2418f
parent1a34f1966c23fbc291a56e9e747aec8eaf9ca2a4 (diff)
Keep track of how many visuals we set up for GLcore, to avoid an invalid free.
The proper fix would involve actually setting up the ARGB visual for GLcore, but I just want the server to not crash at exit.
-rw-r--r--GL/mesa/X/xf86glx.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/GL/mesa/X/xf86glx.c b/GL/mesa/X/xf86glx.c
index 94959d628..47c87f6d9 100644
--- a/GL/mesa/X/xf86glx.c
+++ b/GL/mesa/X/xf86glx.c
@@ -78,6 +78,7 @@ typedef struct __GLXMESAdrawable __GLXMESAdrawable;
struct __GLXMESAscreen {
__GLXscreen base;
int index;
+ int num_vis;
XMesaVisual *xm_vis;
};
@@ -280,7 +281,7 @@ __glXMesaScreenDestroy(__GLXscreen *screen)
__GLXMESAscreen *mesaScreen = (__GLXMESAscreen *) screen;
int i;
- for (i = 0; i < screen->numVisuals; i++) {
+ for (i = 0; i < mesaScreen->num_vis; i++) {
if (mesaScreen->xm_vis[i])
XMesaDestroyVisual(mesaScreen->xm_vis[i]);
}
@@ -389,6 +390,7 @@ static void init_screen_visuals(__GLXMESAscreen *screen)
xfree(used);
+ screen->num_vis = pScreen->numVisuals;
screen->xm_vis = pXMesaVisual;
}