Commit ca741177 authored by Ulrich Sibiller's avatar Ulrich Sibiller

CloseDevice: call XkbRemoveResourceClient before freeing key class struct

This patch is not necessary at the current code level. But when xkb code introduced the dev->key check Xorg upstream missed that. So we backport it now to skip that trap when updating xkb code. Author: Alan Coopersmith <alan.coopersmith@sun.com> Date: Mon Jan 4 18:21:54 2010 -0800 CloseDevice: call XkbRemoveResourceClient before freeing key class struct XkbRemoveResourceClient() returns immediately if dev->key is NULL. CloseDevice calls XkbRemoveResourceClient until it removes all resources. If we free dev->key and NULL it before XkbRemoveResourceClient, then infinite loop ensues, and the server appears to hang on exit or crash. Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@sun.com> Reviewed-by: 's avatarPeter Hutterer <peter.hutterer@who-t.net> Reviewed-by: 's avatarDaniel Stone <daniel@fooishbar.org> Signed-off-by: 's avatarKeith Packard <keithp@keithp.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent 340de78e
......@@ -203,7 +203,15 @@ CloseDevice(register DeviceIntPtr dev)
if (dev->inited)
(void)(*dev->deviceProc)(dev, DEVICE_CLOSE);
#ifdef XKB
while (dev->xkb_interest) {
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
}
#endif
free(dev->name);
if (dev->key)
{
#ifdef XKB
......@@ -267,11 +275,6 @@ CloseDevice(register DeviceIntPtr dev)
#endif
free(l);
}
#ifdef XKB
while (dev->xkb_interest) {
XkbRemoveResourceClient((DevicePtr)dev,dev->xkb_interest->resource);
}
#endif
free(dev->sync.event);
free(dev);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment