[PATCH 20/24] dix: remove all listeners when freeing a touch

Peter Hutterer peter.hutterer at who-t.net
Thu May 9 22:30:55 PDT 2013


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 dix/touch.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dix/touch.c b/dix/touch.c
index fb218d4..0099914 100644
--- a/dix/touch.c
+++ b/dix/touch.c
@@ -263,6 +263,7 @@ void
 TouchFreeTouchPoint(DeviceIntPtr device, int index)
 {
     TouchPointInfoPtr ti;
+    int i;
 
     if (!device->touch || index >= device->touch->num_touches)
         return;
@@ -271,6 +272,9 @@ TouchFreeTouchPoint(DeviceIntPtr device, int index)
     if (ti->active)
         TouchEndTouch(device, ti);
 
+    for (i = 0; i < ti->num_listeners; i++)
+        TouchRemoveListener(ti, ti->listeners[0].listener);
+
     valuator_mask_free(&ti->valuators);
     free(ti->sprite.spriteTrace);
     ti->sprite.spriteTrace = NULL;
-- 
1.8.1.4



More information about the xorg-devel mailing list