[PATCH 2/3] Close GPU screens before core screens

Keith Packard keithp at keithp.com
Tue Aug 7 17:49:47 PDT 2012


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 at keithp.com>
---
 dix/main.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/dix/main.c b/dix/main.c
index 42f517d..fb935c9 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;
-- 
1.7.10.4



More information about the xorg-devel mailing list