summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2012-08-24 13:23:01 +1000
committerDave Airlie <airlied@redhat.com>2012-09-04 16:15:52 +1000
commit49ec57d5094be0dd2b67435ac7bb04ead780f36d (patch)
tree55649ee1eade668be406626f22d935488dbe778a
parent20f601a0fbc01a4f8ab85e54ee45f78f7817cdb5 (diff)
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>
-rw-r--r--dix/dispatch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/dix/dispatch.c b/dix/dispatch.c
index 3c6a591db..0ce10c2f7 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -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);
}