glx: Ignore DRI2 event for drawables we've destroyed
authorKristian Høgsberg <krh@bitplanet.net>
Wed, 8 Sep 2010 22:54:30 +0000 (18:54 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Wed, 8 Sep 2010 22:54:48 +0000 (18:54 -0400)
Since we now actually destroy GLX drawables, we get into situations where
we get events for drawables that no longer exist.  Just ignore the
event in that case.

src/glx/dri2.c

index d4108986489fad1137ad901b6371d93b93589f3e..30999c899a7e32a48d8d3b04e279cd3ea82a23f2 100644 (file)
@@ -103,7 +103,7 @@ DRI2WireToEvent(Display *dpy, XEvent *event, xEvent *wire)
 
       /* Ignore swap events if we're not looking for them */
       pdraw = dri2GetGlxDrawableFromXDrawableId(dpy, awire->drawable);
-      if (!(pdraw->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
+      if (!pdraw || !(pdraw->eventMask & GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK))
         return False;
 
       aevent->serial = _XSetLastRequestRead(dpy, (xGenericReply *) wire);