dix: free default colormap before screen deletion

If we don't free this here, it gets freed later in the resource
cleanups, however it then looks up up pmap->pScreen, which we
freed already in this function. So free the default colormap
when we should.

This fixes a bug after a couple of hotplug cycles when you try
to exit the X server and it crashes.

Reviewed-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie 2012-08-24 13:23:01 +10:00
parent 20f601a0fb
commit 49ec57d509
1 changed files with 4 additions and 0 deletions

View File

@ -3904,6 +3904,10 @@ RemoveGPUScreen(ScreenPtr pScreen)
}
screenInfo.numGPUScreens--;
/* this gets freed later in the resource list, but without
* the screen existing it causes crashes - so remove it here */
if (pScreen->defColormap)
FreeResource(pScreen->defColormap, RT_COLORMAP);
free(pScreen);
}