mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-31 00:50:09 +01:00
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: Michel Dänzer <daenzer@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 3083c5d0c4)
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
4520d5cc5f
commit
d33b3bf41b
1 changed files with 1 additions and 1 deletions
|
|
@ -618,10 +618,10 @@ CreateSaverWindow (ScreenPtr 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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue