Does what it says on the box, compliments MakeInputMask.

Signed-off-by: Peter Hutterer <[email protected]>
---
Changes to v1:
- Take double-pointer and reset it to NULL

 Xi/exevents.c |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/Xi/exevents.c b/Xi/exevents.c
index f530310..20495e7 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);
-- 
1.7.7
_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to