summaryrefslogtreecommitdiff
path: root/xfixes
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 /xfixes
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 'xfixes')
-rw-r--r--xfixes/cursor.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/xfixes/cursor.c b/xfixes/cursor.c
index 90a026b28..753d5f7bc 100644
--- a/xfixes/cursor.c
+++ b/xfixes/cursor.c
@@ -613,12 +613,12 @@ ReplaceCursorLookup(pointer value, XID id, pointer closure)
}
if (pCursor && pCursor != rcl->pNew) {
if ((*rcl->testCursor) (pCursor, rcl->closure)) {
- rcl->pNew->refcnt++;
+ CursorPtr curs = RefCursor(rcl->pNew);
/* either redirect reference or update resource database */
if (pCursorRef)
- *pCursorRef = rcl->pNew;
+ *pCursorRef = curs;
else
- ChangeResourceValue(id, RT_CURSOR, rcl->pNew);
+ ChangeResourceValue(id, RT_CURSOR, curs);
FreeCursor(pCursor, cursor);
}
}