dix: let FreeGCperDepth() operate on ScreenPtr and NULL protect it
Instead of retrieving the screen index from ScreenRec and passing this, so the ScreenRec is looked up again, just pass in the ScreenPtr that already have anyways. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
1eaf1b0191
commit
d56d8307c1
7
dix/gc.c
7
dix/gc.c
|
@ -821,13 +821,14 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
|
|||
}
|
||||
|
||||
void
|
||||
FreeGCperDepth(int screenNum)
|
||||
FreeGCperDepth(ScreenPtr pScreen)
|
||||
{
|
||||
int i;
|
||||
ScreenPtr pScreen;
|
||||
GCPtr *ppGC;
|
||||
|
||||
pScreen = screenInfo.screens[screenNum];
|
||||
if (!pScreen)
|
||||
return;
|
||||
|
||||
ppGC = pScreen->GCperDepth;
|
||||
|
||||
for (i = 0; i <= pScreen->numDepths; i++) {
|
||||
|
|
|
@ -22,7 +22,7 @@ int CopyGC(GCPtr pgcSrc, GCPtr pgcDst, BITS32 mask);
|
|||
|
||||
int FreeGC(void *pGC, XID gid);
|
||||
|
||||
void FreeGCperDepth(int screenNum);
|
||||
void FreeGCperDepth(ScreenPtr pScreen);
|
||||
|
||||
Bool CreateGCperDepth(int screenNum);
|
||||
|
||||
|
|
|
@ -334,7 +334,7 @@ dix_main(int argc, char *argv[], char *envp[])
|
|||
}
|
||||
|
||||
for (i = screenInfo.numScreens - 1; i >= 0; i--) {
|
||||
FreeGCperDepth(i);
|
||||
FreeGCperDepth(screenInfo.screens[i]);
|
||||
FreeDefaultStipple(i);
|
||||
dixFreeScreenSpecificPrivates(screenInfo.screens[i]);
|
||||
(*screenInfo.screens[i]->CloseScreen) (screenInfo.screens[i]);
|
||||
|
|
Loading…
Reference in New Issue