Commit 238a4b68 authored by Ulrich Sibiller's avatar Ulrich Sibiller Committed by Mike Gabriel

Xext: Fix cursor reference counting hazard.

Backport of this xorg-xserver patch: commit 3083c5d0c4386cdd7083b7a83ac72fdad2f1e61e Author: Michel Dänzer <daenzer@vmware.com> Date: Mon Mar 22 18:01:17 2010 +0100 Xext: Fix cursor reference counting hazard. Make sure the reference count of the new cursor is increased before the old one is decreased, otherwise bad things will happen if they're one and the same and the reference count is 1 initially. Not sure this can actually happen here, but better safe than sorry. Signed-off-by: 's avatarMichel Dänzer <daenzer@vmware.com> Reviewed-by: 's avatarRoland Scheidegger <sroland@vmware.com> Signed-off-by: 's avatarKeith Packard <keithp@keithp.com>
parent 192112d8
......@@ -642,10 +642,10 @@ CreateSaverWindow (pScreen)
FreeResource (pWin->drawable.id, RT_NONE);
return FALSE;
}
pAttr->pCursor->refcnt++;
if (pWin->optional->cursor)
FreeCursor (pWin->optional->cursor, (Cursor)0);
pWin->optional->cursor = pAttr->pCursor;
pAttr->pCursor->refcnt++;
pWin->cursorIsNone = FALSE;
CheckWindowOptionalNeed (pWin);
mask |= CWCursor;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment