mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 03:44:06 +00:00
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>
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user