mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
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:
@@ -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);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user