From 4b9600a4167427a8fe88bca9b738c9a99cac9469 Mon Sep 17 00:00:00 2001 From: Jamey Sharp Date: Sat, 15 May 2010 12:31:34 -0700 Subject: Make WriteEventsToClient/WriteToClient no-op on fake or dead clients. This matches the test in TryClientEvents, and is a superset of tests done by the callers of these functions. The consequence of forgetting these tests is a server crash, so they're always desirable. In my opinion, it's better to not require the callers to remember to do these checks. For callers that don't do very much work before calling WriteToClient or WriteEventsToClient, I've removed the redundant checks. hw/xquartz/xpr/appledri.c has an interesting case: While its check for "client == NULL" appears redundant with the test in WriteEventsToClient, it dereferences client to get the sequence number. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=27497 Signed-off-by: Jamey Sharp Cc: Chris Wilson Reviewed-by: Julien Cristau Reviewed-by: Adam Jackson --- xfixes/cursor.c | 3 +-- xfixes/select.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'xfixes') diff --git a/xfixes/cursor.c b/xfixes/cursor.c index d5f8b290b..e963069fc 100644 --- a/xfixes/cursor.c +++ b/xfixes/cursor.c @@ -164,8 +164,7 @@ CursorDisplayCursor (DeviceIntPtr pDev, CursorCurrent[pDev->id] = pCursor; for (e = cursorEvents; e; e = e->next) { - if ((e->eventMask & XFixesDisplayCursorNotifyMask) && - !e->pClient->clientGone) + if ((e->eventMask & XFixesDisplayCursorNotifyMask)) { xXFixesCursorNotifyEvent ev; ev.type = XFixesEventBase + XFixesCursorNotify; diff --git a/xfixes/select.c b/xfixes/select.c index 6d86f63af..ffd1c6919 100644 --- a/xfixes/select.c +++ b/xfixes/select.c @@ -78,8 +78,7 @@ XFixesSelectionCallback (CallbackListPtr *callbacks, pointer data, pointer args) for (e = selectionEvents; e; e = e->next) { if (e->selection == selection->selection && - (e->eventMask & eventMask) && - !e->pClient->clientGone) + (e->eventMask & eventMask)) { xXFixesSelectionNotifyEvent ev; -- cgit v1.2.3