summaryrefslogtreecommitdiff
path: root/Xext
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-05-15 19:01:11 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-05-15 19:17:57 +1000
commit9a5ad65330693b3273972b63d10f2907d9ab954a (patch)
tree3717cb1f7b1373bc4a1d29a03739e7b275fc61e2 /Xext
parent35c2e263db01b2b61354298e5e85aa3cae8ac317 (diff)
Abstract cursor refcounting
Too many callers relied on the refcnt being handled correctly. Use a simple wrapper to handle that case. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xext')
-rw-r--r--Xext/saver.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/Xext/saver.c b/Xext/saver.c
index 8de043f8e..fe81bc4d7 100644
--- a/Xext/saver.c
+++ b/Xext/saver.c
@@ -531,15 +531,16 @@ CreateSaverWindow(ScreenPtr pScreen)
mask |= CWBorderPixmap;
}
if (pAttr->pCursor) {
+ CursorPtr cursor;
if (!pWin->optional)
if (!MakeWindowOptional(pWin)) {
FreeResource(pWin->drawable.id, RT_NONE);
return FALSE;
}
- pAttr->pCursor->refcnt++;
+ cursor = RefCursor(pAttr->pCursor);
if (pWin->optional->cursor)
FreeCursor(pWin->optional->cursor, (Cursor) 0);
- pWin->optional->cursor = pAttr->pCursor;
+ pWin->optional->cursor = cursor;
pWin->cursorIsNone = FALSE;
CheckWindowOptionalNeed(pWin);
mask |= CWCursor;
@@ -1065,8 +1066,7 @@ ScreenSaverSetAttributes(ClientPtr client)
client->errorValue = cursorID;
goto PatchUp;
}
- pCursor->refcnt++;
- pAttr->pCursor = pCursor;
+ pAttr->pCursor = RefCursor(pCursor);
pAttr->mask &= ~CWCursor;
}
break;