aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/main.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-06-11 12:14:52 +0000
committermarha <marha@users.sourceforge.net>2010-06-11 12:14:52 +0000
commit4c61bf84b11e26e6f22648668c95ea760a379163 (patch)
tree0ac762ab2815eae283dded7447ad7cb5a54b926a /xorg-server/dix/main.c
parente1dabd2ce8be0d70c6c15353b58de256129dfd1f (diff)
downloadvcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.tar.gz
vcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.tar.bz2
vcxsrv-4c61bf84b11e26e6f22648668c95ea760a379163.zip
xserver git update 11/6/2010
Diffstat (limited to 'xorg-server/dix/main.c')
-rw-r--r--xorg-server/dix/main.c28
1 files changed, 18 insertions, 10 deletions
diff --git a/xorg-server/dix/main.c b/xorg-server/dix/main.c
index 259093236..69f11938b 100644
--- a/xorg-server/dix/main.c
+++ b/xorg-server/dix/main.c
@@ -174,7 +174,7 @@ int main(int argc, char *argv[], char *envp[])
InitProcVectors();
for (i=1; i<MAXCLIENTS; i++)
clients[i] = NullClient;
- serverClient = malloc(sizeof(ClientRec));
+ serverClient = calloc(sizeof(ClientRec), 1);
if (!serverClient)
FatalError("couldn't create server client");
InitClient(serverClient, 0, (pointer)NULL);
@@ -184,6 +184,12 @@ int main(int argc, char *argv[], char *envp[])
clients[0] = serverClient;
currentMaxClients = 1;
+ /* Initialize server client devPrivates, to be reallocated as
+ * more client privates are registered
+ */
+ if (!dixAllocatePrivates(&serverClient->devPrivates, PRIVATE_CLIENT))
+ FatalError("failed to create server client privates");
+
if (!InitClientResources(serverClient)) /* for root resources */
FatalError("couldn't init server resources");
@@ -194,8 +200,7 @@ int main(int argc, char *argv[], char *envp[])
InitEvents();
InitSelections();
InitGlyphCaching();
- if (!dixResetPrivates())
- FatalError("couldn't init private data storage");
+ dixResetPrivates();
dixResetRegistry();
ResetFontPrivateIndex();
InitCallbackManager();
@@ -204,6 +209,7 @@ int main(int argc, char *argv[], char *envp[])
if (screenInfo.numScreens < 1)
FatalError("no screens found");
InitExtensions(argc, argv);
+
for (i = 0; i < screenInfo.numScreens; i++)
{
ScreenPtr pScreen = screenInfo.screens[i];
@@ -249,7 +255,7 @@ int main(int argc, char *argv[], char *envp[])
#endif
for (i = 0; i < screenInfo.numScreens; i++)
- InitRootWindow(WindowTable[i]);
+ InitRootWindow(screenInfo.screens[i]->root);
InitCoreDevices();
InitInput(argc, argv);
@@ -303,7 +309,8 @@ int main(int argc, char *argv[], char *envp[])
CloseInput();
- memset(WindowTable, 0, sizeof(WindowTable));
+ for (i = 0; i < screenInfo.numScreens; i++)
+ screenInfo.screens[i]->root = NullWindow;
CloseDownDevices();
CloseDownEvents();
@@ -313,17 +320,18 @@ int main(int argc, char *argv[], char *envp[])
FreeGCperDepth(i);
FreeDefaultStipple(i);
(* screenInfo.screens[i]->CloseScreen)(i, screenInfo.screens[i]);
- dixFreePrivates(screenInfo.screens[i]->devPrivates);
+ dixFreePrivates(screenInfo.screens[i]->devPrivates, PRIVATE_SCREEN);
free(screenInfo.screens[i]);
screenInfo.numScreens = i;
}
+
+ dixFreePrivates(serverClient->devPrivates, PRIVATE_CLIENT);
+ serverClient->devPrivates = NULL;
+
FreeFonts();
FreeAuditTimer();
- dixFreePrivates(serverClient->devPrivates);
- serverClient->devPrivates = NULL;
-
if (dispatchException & DE_TERMINATE)
{
CloseWellKnownConnections();
@@ -340,6 +348,6 @@ int main(int argc, char *argv[], char *envp[])
free(ConnectionInfo);
ConnectionInfo = NULL;
}
- return(0);
+ return 0;
}