diff options
Diffstat (limited to 'nx-X11/programs/Xserver/dix')
-rw-r--r-- | nx-X11/programs/Xserver/dix/devices.c | 13 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/dix/dispatch.c | 3 | ||||
-rw-r--r-- | nx-X11/programs/Xserver/dix/events.c | 25 |
3 files changed, 19 insertions, 22 deletions
diff --git a/nx-X11/programs/Xserver/dix/devices.c b/nx-X11/programs/Xserver/dix/devices.c index 51cf3fef9..8ad1cc371 100644 --- a/nx-X11/programs/Xserver/dix/devices.c +++ b/nx-X11/programs/Xserver/dix/devices.c @@ -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); } diff --git a/nx-X11/programs/Xserver/dix/dispatch.c b/nx-X11/programs/Xserver/dix/dispatch.c index 6b6dbcad9..d656da748 100644 --- a/nx-X11/programs/Xserver/dix/dispatch.c +++ b/nx-X11/programs/Xserver/dix/dispatch.c @@ -4150,7 +4150,10 @@ AddScreen(Bool (*pfnInit) (ScreenPtr /*pScreen */ , pScreen->devPrivates = (DevUnion *)calloc(sizeof(DevUnion), screenPrivateCount); if (!pScreen->devPrivates && screenPrivateCount) + { + free(pScreen); return -1; + } ret = init_screen(pScreen, i); if (ret != 0) { diff --git a/nx-X11/programs/Xserver/dix/events.c b/nx-X11/programs/Xserver/dix/events.c index 745932af3..70224c3b8 100644 --- a/nx-X11/programs/Xserver/dix/events.c +++ b/nx-X11/programs/Xserver/dix/events.c @@ -1938,10 +1938,8 @@ XYToWindow(int x, int y) if (spriteTraceGood >= spriteTraceSize) { spriteTraceSize += 10; - Must_have_memory = TRUE; /* XXX */ - spriteTrace = (WindowPtr *)realloc( + spriteTrace = realloc( spriteTrace, spriteTraceSize*sizeof(WindowPtr)); - Must_have_memory = FALSE; /* XXX */ } spriteTrace[spriteTraceGood++] = pWin; pWin = pWin->firstChild; @@ -2455,11 +2453,9 @@ CheckPassiveGrabsOnWindow( { if (device->sync.evcount < count) { - Must_have_memory = TRUE; /* XXX */ - device->sync.event = (xEvent *)realloc(device->sync.event, - count* - sizeof(xEvent)); - Must_have_memory = FALSE; /* XXX */ + device->sync.event = realloc(device->sync.event, + count* + sizeof(xEvent)); } device->sync.evcount = count; for (dxE = device->sync.event; --count >= 0; dxE++, xE++) @@ -2627,10 +2623,8 @@ DeliverGrabbedEvent(register xEvent *xE, register DeviceIntPtr thisDev, FreezeThaw(thisDev, TRUE); if (thisDev->sync.evcount < count) { - Must_have_memory = TRUE; /* XXX */ - thisDev->sync.event = (xEvent *)realloc(thisDev->sync.event, - count*sizeof(xEvent)); - Must_have_memory = FALSE; /* XXX */ + thisDev->sync.event = realloc(thisDev->sync.event, + count*sizeof(xEvent)); } thisDev->sync.evcount = count; for (dxE = thisDev->sync.event; --count >= 0; dxE++, xE++) @@ -3505,11 +3499,8 @@ SetInputFocus( if (depth > focus->traceSize) { focus->traceSize = depth+1; - Must_have_memory = TRUE; /* XXX */ - focus->trace = (WindowPtr *)realloc(focus->trace, - focus->traceSize * - sizeof(WindowPtr)); - Must_have_memory = FALSE; /* XXX */ + focus->trace = realloc(focus->trace, + focus->traceSize * sizeof(WindowPtr)); } focus->traceGood = depth; for (pWin = focusWin, depth--; pWin; pWin = pWin->parent, depth--) |