summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2013-04-24 12:53:52 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2013-05-10 14:32:38 +1000
commit34c9b39d9937c2e19c2dffc9748605f90d40f965 (patch)
tree200440b2030e6628cfcd5994b57289304670a617 /dix
parent395124bd2782823de37e5c5b2f15dba49cff05f6 (diff)
dix: remove all listeners when freeing a touch
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'dix')
-rw-r--r--dix/touch.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/dix/touch.c b/dix/touch.c
index fb218d4b1..009991433 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;