Unverified Commit 4a440fea authored by Mike Gabriel's avatar Mike Gabriel

Merge branch 'uli42-pr/fix_xkb_privates' into 3.6.x

parents abf37413 3aabc92c
...@@ -73,6 +73,8 @@ SOFTWARE. ...@@ -73,6 +73,8 @@ SOFTWARE.
#include "swaprep.h" #include "swaprep.h"
#include "dixevents.h" #include "dixevents.h"
extern void XkbFreePrivates(DeviceIntPtr device);
DeviceIntPtr DeviceIntPtr
AddInputDevice(DeviceProc deviceProc, Bool autoStart) AddInputDevice(DeviceProc deviceProc, Bool autoStart)
{ {
...@@ -275,6 +277,13 @@ CloseDevice(register DeviceIntPtr dev) ...@@ -275,6 +277,13 @@ CloseDevice(register DeviceIntPtr dev)
#endif #endif
free(l); free(l);
} }
#ifdef XKB
XkbFreePrivates(dev);
#endif
free(dev->devPrivates);
free(dev->sync.event); free(dev->sync.event);
free(dev); free(dev);
} }
......
...@@ -1034,14 +1034,6 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio ...@@ -1034,14 +1034,6 @@ Reply Total Cached Bits In Bits Out Bits/Reply Ratio
fprintf(stderr, "nxagentKeyboardProc: Called for [DEVICE_CLOSE].\n"); fprintf(stderr, "nxagentKeyboardProc: Called for [DEVICE_CLOSE].\n");
#endif #endif
for (int i = 0; i < pDev->nPrivates; i++)
{
free(pDev->devPrivates[i].ptr);
pDev->devPrivates[i].ptr = NULL;
}
free(pDev->devPrivates);
pDev->devPrivates = NULL;
break; break;
} }
......
...@@ -166,14 +166,6 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff) ...@@ -166,14 +166,6 @@ int nxagentPointerProc(DeviceIntPtr pDev, int onoff)
fprintf(stderr, "nxagentPointerProc: Called for [DEVICE_CLOSE].\n"); fprintf(stderr, "nxagentPointerProc: Called for [DEVICE_CLOSE].\n");
#endif #endif
for (int i = 0; i < pDev->nPrivates; i++)
{
free(pDev->devPrivates[i].ptr);
pDev->devPrivates[i].ptr = NULL;
}
free(pDev->devPrivates);
pDev->devPrivates = NULL;
break; break;
} }
......
...@@ -81,6 +81,20 @@ XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc) ...@@ -81,6 +81,20 @@ XkbSetExtension(DeviceIntPtr device, ProcessInputProc proc)
proc,xkbUnwrapProc); proc,xkbUnwrapProc);
} }
void
XkbFreePrivates(DeviceIntPtr device)
{
if (device &&
device->devPrivates &&
device->nPrivates > 0 &&
xkbDevicePrivateIndex != -1 &&
xkbDevicePrivateIndex < device->nPrivates)
{
free(device->devPrivates[xkbDevicePrivateIndex].ptr);
device->devPrivates[xkbDevicePrivateIndex].ptr = NULL;
}
}
#ifdef XINPUT #ifdef XINPUT
extern void ProcessOtherEvent( extern void ProcessOtherEvent(
xEvent * /* xE */, xEvent * /* xE */,
......
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