summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2012-08-07 17:49:47 -0700
committerKeith Packard <keithp@keithp.com>2012-08-14 17:13:52 -0700
commit288b87e42cbb5db34cda848143655e84af8455da (patch)
tree948f65808a3fffc9dc319dbe635aa993cc50eee2
parent19772670e3041fe1c7f5bbf32fa039a6d8245ccb (diff)
Close GPU screens before core screens
This should make cleaning up the GPU screens easier as the core screens they are associated with will still be around. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--dix/main.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/dix/main.c b/dix/main.c
index 42f517dfd..fb935c969 100644
--- a/dix/main.c
+++ b/dix/main.c
@@ -331,6 +331,15 @@ main(int argc, char *argv[], char *envp[])
CloseDownEvents();
+ for (i = screenInfo.numGPUScreens - 1; i >= 0; i--) {
+ ScreenPtr pScreen = screenInfo.gpuscreens[i];
+ FreeScratchPixmapsForScreen(pScreen);
+ (*pScreen->CloseScreen) (pScreen);
+ dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN);
+ free(pScreen);
+ screenInfo.numGPUScreens = i;
+ }
+
for (i = screenInfo.numScreens - 1; i >= 0; i--) {
FreeScratchPixmapsForScreen(screenInfo.screens[i]);
FreeGCperDepth(i);
@@ -342,15 +351,6 @@ main(int argc, char *argv[], char *envp[])
screenInfo.numScreens = i;
}
- for (i = screenInfo.numGPUScreens - 1; i >= 0; i--) {
- ScreenPtr pScreen = screenInfo.gpuscreens[i];
- FreeScratchPixmapsForScreen(pScreen);
- (*pScreen->CloseScreen) (pScreen);
- dixFreePrivates(pScreen->devPrivates, PRIVATE_SCREEN);
- free(pScreen);
- screenInfo.numGPUScreens = i;
- }
-
ReleaseClientIds(serverClient);
dixFreePrivates(serverClient->devPrivates, PRIVATE_CLIENT);
serverClient->devPrivates = NULL;