diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-18 20:06:29 +1030 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-01-18 20:07:20 +1030 |
commit | 8a925d201efac52ef663ea3ff46acc5046178666 (patch) | |
tree | 0b67e9033144d035c427a0f62ac87eb2205a59b0 /dix/events.c | |
parent | 8949d81a3c79eef351d7c018c76692dcca74b63e (diff) |
dix: free the genericMasks when ungrabbing.
This finally plugs a memory hole created by grabs registering for generic
events.
Diffstat (limited to 'dix/events.c')
-rw-r--r-- | dix/events.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/dix/events.c b/dix/events.c index c3697da88..de68b570c 100644 --- a/dix/events.c +++ b/dix/events.c @@ -1627,6 +1627,14 @@ DeactivatePointerGrab(DeviceIntPtr mouse) mouse->deviceGrab.grab = NullGrab; mouse->deviceGrab.sync.state = NOT_GRABBED; mouse->deviceGrab.fromPassiveGrab = FALSE; + + /* make sure the potential XGE event mask is freed too*/ + if (grab->genericMasks) + { + xfree(grab->genericMasks); + grab->genericMasks = NULL; + } + for (dev = inputInfo.devices; dev; dev = dev->next) { if (dev->deviceGrab.sync.other == grab) @@ -1704,6 +1712,12 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd) keybd->deviceGrab.grab = NullGrab; keybd->deviceGrab.sync.state = NOT_GRABBED; keybd->deviceGrab.fromPassiveGrab = FALSE; + if (grab->genericMasks) + { + xfree(grab->genericMasks); + grab->genericMasks = NULL; + } + for (dev = inputInfo.devices; dev; dev = dev->next) { if (dev->deviceGrab.sync.other == grab) @@ -2226,9 +2240,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent inputMasks = wOtherInputMasks(pWin); tempGrab.deviceMask = (inputMasks) ? inputMasks->inputEvents[pDev->id]: 0; - /* get the XGE event mask. - * FIXME: needs to be freed somewhere too. - */ + /* get the XGE event mask. */ tempGrab.genericMasks = NULL; if (pWin->optional && pWin->optional->geMasks) { |