[PATCH v3 09/11] dri2: Check that client still except the event before sending it

Pauli ext-pauli.nieminen at nokia.com
Wed Feb 16 02:21:43 PST 2011


From: Pauli Nieminen <ext-pauli.nieminen at nokia.com>

If client calls DRI2DestroyDrawable to free DRI2 drawable the client
isn't any more intrested in DRI2 events. To avoid confusing the client
we should avoid sending the event to the client.

Signed-off-by: Pauli Nieminen <ext-pauli.nieminen at nokia.com>
---
 hw/xfree86/dri2/dri2.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 28b72f5..145286d 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -856,6 +856,7 @@ DRI2SwapComplete2(DRI2DrawablePtr pPriv, int frame,
     ClientPtr               client = pSwapData->event.client;
     DrawablePtr             pDraw = pPriv->drawable;
     CARD64                  ust = 0;
+    DRI2DrawableRefPtr      ref;
 
     pPriv->swapsPending--;
     pPriv->swap_count++;
@@ -866,6 +867,11 @@ DRI2SwapComplete2(DRI2DrawablePtr pPriv, int frame,
     if (client == NULL)
 	goto out;
 
+    ref = DRI2LookupClientDrawableRef(pPriv, client, 0);
+
+    if (ref == NULL)
+	goto out;
+
     if (pDraw) {
 	BoxRec          box;
 	RegionRec       region;
-- 
1.7.0.4



More information about the xorg-devel mailing list