xorg-x11-server/0027-dix-remove-all-listeners-when-freeing-a-touch.patch

37 lines
1.1 KiB
Diff

From 43e97926e144ebd7180fe9a8dbd27dbf73e3aa08 Mon Sep 17 00:00:00 2001
From: Peter Hutterer <peter.hutterer@who-t.net>
Date: Wed, 24 Apr 2013 12:53:52 +1000
Subject: [PATCH 27/35] dix: remove all listeners when freeing a touch
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit 34c9b39d9937c2e19c2dffc9748605f90d40f965)
---
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.2.1