dix: free the genericMasks when ungrabbing.
This finally plugs a memory hole created by grabs registering for generic events.
This commit is contained in:
parent
8949d81a3c
commit
8a925d201e
18
dix/events.c
18
dix/events.c
|
@ -1627,6 +1627,14 @@ DeactivatePointerGrab(DeviceIntPtr mouse)
|
||||||
mouse->deviceGrab.grab = NullGrab;
|
mouse->deviceGrab.grab = NullGrab;
|
||||||
mouse->deviceGrab.sync.state = NOT_GRABBED;
|
mouse->deviceGrab.sync.state = NOT_GRABBED;
|
||||||
mouse->deviceGrab.fromPassiveGrab = FALSE;
|
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)
|
for (dev = inputInfo.devices; dev; dev = dev->next)
|
||||||
{
|
{
|
||||||
if (dev->deviceGrab.sync.other == grab)
|
if (dev->deviceGrab.sync.other == grab)
|
||||||
|
@ -1704,6 +1712,12 @@ DeactivateKeyboardGrab(DeviceIntPtr keybd)
|
||||||
keybd->deviceGrab.grab = NullGrab;
|
keybd->deviceGrab.grab = NullGrab;
|
||||||
keybd->deviceGrab.sync.state = NOT_GRABBED;
|
keybd->deviceGrab.sync.state = NOT_GRABBED;
|
||||||
keybd->deviceGrab.fromPassiveGrab = FALSE;
|
keybd->deviceGrab.fromPassiveGrab = FALSE;
|
||||||
|
if (grab->genericMasks)
|
||||||
|
{
|
||||||
|
xfree(grab->genericMasks);
|
||||||
|
grab->genericMasks = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
for (dev = inputInfo.devices; dev; dev = dev->next)
|
for (dev = inputInfo.devices; dev; dev = dev->next)
|
||||||
{
|
{
|
||||||
if (dev->deviceGrab.sync.other == grab)
|
if (dev->deviceGrab.sync.other == grab)
|
||||||
|
@ -2226,9 +2240,7 @@ DeliverEventsToWindow(DeviceIntPtr pDev, WindowPtr pWin, xEvent
|
||||||
inputMasks = wOtherInputMasks(pWin);
|
inputMasks = wOtherInputMasks(pWin);
|
||||||
tempGrab.deviceMask = (inputMasks) ? inputMasks->inputEvents[pDev->id]: 0;
|
tempGrab.deviceMask = (inputMasks) ? inputMasks->inputEvents[pDev->id]: 0;
|
||||||
|
|
||||||
/* get the XGE event mask.
|
/* get the XGE event mask. */
|
||||||
* FIXME: needs to be freed somewhere too.
|
|
||||||
*/
|
|
||||||
tempGrab.genericMasks = NULL;
|
tempGrab.genericMasks = NULL;
|
||||||
if (pWin->optional && pWin->optional->geMasks)
|
if (pWin->optional && pWin->optional->geMasks)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue