Check for clientGone before sending events from XFixes (bug #1753).

Freeing resources during client closedown can cause cursor changes which
attempt to send cursor events through the XFixes extension; a client in the
process of closing down has no file to send events to, causing a crash when
this path is hit.
This commit is contained in:
Keith Packard 2007-02-19 15:28:37 -08:00
parent 4660eaaffb
commit 8a42af6a93
2 changed files with 5 additions and 2 deletions

View File

@ -143,7 +143,8 @@ CursorDisplayCursor (ScreenPtr pScreen,
CursorCurrent = pCursor; CursorCurrent = pCursor;
for (e = cursorEvents; e; e = e->next) for (e = cursorEvents; e; e = e->next)
{ {
if (e->eventMask & XFixesDisplayCursorNotifyMask) if ((e->eventMask & XFixesDisplayCursorNotifyMask) &&
!e->pClient->clientGone)
{ {
xXFixesCursorNotifyEvent ev; xXFixesCursorNotifyEvent ev;
ev.type = XFixesEventBase + XFixesCursorNotify; ev.type = XFixesEventBase + XFixesCursorNotify;

View File

@ -78,7 +78,9 @@ XFixesSelectionCallback (CallbackListPtr *callbacks, pointer data, pointer args)
} }
for (e = selectionEvents; e; e = e->next) for (e = selectionEvents; e; e = e->next)
{ {
if (e->selection == selection->selection && (e->eventMask & eventMask)) if (e->selection == selection->selection &&
(e->eventMask & eventMask) &&
!e->pClient->clientGone)
{ {
xXFixesSelectionNotifyEvent ev; xXFixesSelectionNotifyEvent ev;