Skip to content

Commit

Permalink
Keep track of how many visuals we set up for GLcore, to avoid an inva…
Browse files Browse the repository at this point in the history
…lid 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.
  • Loading branch information
anholt authored and Keith Packard committed Jan 30, 2007
1 parent 1a34f19 commit cd5fe78
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion GL/mesa/X/xf86glx.c
Expand Up @@ -78,6 +78,7 @@ typedef struct __GLXMESAdrawable __GLXMESAdrawable;
struct __GLXMESAscreen {
__GLXscreen base;
int index;
int num_vis;
XMesaVisual *xm_vis;
};

Expand Down Expand Up @@ -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]);
}
Expand Down Expand Up @@ -389,6 +390,7 @@ static void init_screen_visuals(__GLXMESAscreen *screen)

xfree(used);

screen->num_vis = pScreen->numVisuals;
screen->xm_vis = pXMesaVisual;
}

Expand Down

0 comments on commit cd5fe78

Please sign in to comment.