(!1905) 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
f56b42d81a
commit
453df97210
7
dix/gc.c
7
dix/gc.c
|
@ -821,13 +821,14 @@ CreateScratchGC(ScreenPtr pScreen, unsigned depth)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
FreeGCperDepth(int screenNum)
|
FreeGCperDepth(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
ScreenPtr pScreen;
|
|
||||||
GCPtr *ppGC;
|
GCPtr *ppGC;
|
||||||
|
|
||||||
pScreen = screenInfo.screens[screenNum];
|
if (!pScreen)
|
||||||
|
return;
|
||||||
|
|
||||||
ppGC = pScreen->GCperDepth;
|
ppGC = pScreen->GCperDepth;
|
||||||
|
|
||||||
for (i = 0; i <= pScreen->numDepths; i++) {
|
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);
|
int FreeGC(void *pGC, XID gid);
|
||||||
|
|
||||||
void FreeGCperDepth(int screenNum);
|
void FreeGCperDepth(ScreenPtr pScreen);
|
||||||
|
|
||||||
Bool CreateGCperDepth(int screenNum);
|
Bool CreateGCperDepth(int screenNum);
|
||||||
|
|
||||||
|
|
|
@ -327,7 +327,7 @@ dix_main(int argc, char *argv[], char *envp[])
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = screenInfo.numScreens - 1; i >= 0; i--) {
|
for (i = screenInfo.numScreens - 1; i >= 0; i--) {
|
||||||
FreeGCperDepth(i);
|
FreeGCperDepth(screenInfo.screens[i]);
|
||||||
FreeDefaultStipple(i);
|
FreeDefaultStipple(i);
|
||||||
dixFreeScreenSpecificPrivates(screenInfo.screens[i]);
|
dixFreeScreenSpecificPrivates(screenInfo.screens[i]);
|
||||||
(*screenInfo.screens[i]->CloseScreen) (screenInfo.screens[i]);
|
(*screenInfo.screens[i]->CloseScreen) (screenInfo.screens[i]);
|
||||||
|
|
Loading…
Reference in New Issue