summaryrefslogtreecommitdiff
path: root/composite/compinit.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-05-04 21:52:58 -0700
committerKeith Packard <keithp@keithp.com>2008-05-04 21:54:27 -0700
commitefa65a0317e12c9ad34fa00fe90bf5eae9fa2670 (patch)
tree5cc040afbe8f8be44509b38479c669b9fdf3e9aa /composite/compinit.c
parent6c1accce87c9bd640c1b4bbc49bae7d44b1cc97b (diff)
Rework composite overlay window code to fix several resource management bugs.
The composite overlay window code had several misunderstandings of the workings of the X server, in particular error handling paths would often double-free objects. Clean all of this up by using resource destruction as the sole mechanism for freeing resource-based objects.
Diffstat (limited to 'composite/compinit.c')
-rw-r--r--composite/compinit.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/composite/compinit.c b/composite/compinit.c
index 49b2044b0..7914a8d25 100644
--- a/composite/compinit.c
+++ b/composite/compinit.c
@@ -76,14 +76,6 @@ compCloseScreen (int index, ScreenPtr pScreen)
pScreen->CopyWindow = cs->CopyWindow;
pScreen->PositionWindow = cs->PositionWindow;
- deleteCompOverlayClientsForScreen(pScreen);
-
- /*
- ** Note: no need to call DeleteWindow; the server has
- ** already destroyed it.
- */
- cs->pOverlayWin = NULL;
-
xfree (cs);
dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
ret = (*pScreen->CloseScreen) (index, pScreen);
@@ -122,11 +114,11 @@ compChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
if (ret && (mask & CWBackingStore)) {
if (pWin->backingStore != NotUseful) {
compRedirectWindow(serverClient, pWin, CompositeRedirectAutomatic);
- pWin->backStorage = TRUE;
+ pWin->backStorage = (pointer) (intptr_t) 1;
} else {
compUnredirectWindow(serverClient, pWin,
CompositeRedirectAutomatic);
- pWin->backStorage = FALSE;
+ pWin->backStorage = NULL;
}
}
@@ -380,6 +372,7 @@ compScreenInit (ScreenPtr pScreen)
return FALSE;
cs->damaged = FALSE;
+ cs->overlayWid = FakeClientID(0);
cs->pOverlayWin = NULL;
cs->pOverlayClients = NULL;