summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-11-04 15:49:23 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-11-29 15:12:59 +1000
commit61ef4daf6450da573b9de72ba7b200566821b916 (patch)
tree2f329dde1bfd3bbf58363bc188f58e9339afa227
parentee9346bb31efce4036df1b8dd8f1a5dc43ae955a (diff)
Xi: add FreeInputMask function
Does what it says on the box, complements MakeInputMask. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
-rw-r--r--Xi/exevents.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index f53031013..20495e74d 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -1678,6 +1678,13 @@ MakeInputMasks(WindowPtr pWin)
return TRUE;
}
+static void
+FreeInputMask(OtherInputMasks **imask)
+{
+ free(*imask);
+ *imask = NULL;
+}
+
void
RecalculateDeviceDeliverableEvents(WindowPtr pWin)
{
@@ -1737,8 +1744,9 @@ InputClientGone(WindowPtr pWin, XID id)
FreeInputClient(&other);
} else if (!(other->next)) {
if (ShouldFreeInputMasks(pWin, TRUE)) {
- wOtherInputMasks(pWin)->inputClients = other->next;
- free(wOtherInputMasks(pWin));
+ OtherInputMasks *mask = wOtherInputMasks(pWin);
+ mask->inputClients = other->next;
+ FreeInputMask(&mask);
pWin->optional->inputMasks = (OtherInputMasks *) NULL;
CheckWindowOptionalNeed(pWin);
FreeInputClient(&other);