aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/main.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-06-11 14:16:16 +0000
committermarha <marha@users.sourceforge.net>2010-06-11 14:16:16 +0000
commitd1e4f4b8546c7955c66dd023bfd6ef437db9d21d (patch)
tree529985e77bfc95aa95fe5b540e8f42b0ef041206 /xorg-server/dix/main.c
parent13919cf85a6ca41d97238de13344aba59e0f7680 (diff)
parent4c61bf84b11e26e6f22648668c95ea760a379163 (diff)
downloadvcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.tar.gz
vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.tar.bz2
vcxsrv-d1e4f4b8546c7955c66dd023bfd6ef437db9d21d.zip
svn merge ^/branches/released .
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 a4080d39f..187f2e51d 100644
--- a/xorg-server/dix/main.c
+++ b/xorg-server/dix/main.c
@@ -218,7 +218,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);
@@ -228,6 +228,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");
@@ -238,8 +244,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();
@@ -248,6 +253,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];
@@ -293,7 +299,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);
@@ -347,7 +353,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();
@@ -357,17 +364,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();
@@ -384,6 +392,6 @@ int main(int argc, char *argv[], char *envp[])
free(ConnectionInfo);
ConnectionInfo = NULL;
}
- return(0);
+ return 0;
}