diff options
author | Keith Packard <keithp@keithp.com> | 2009-09-17 18:14:31 -0700 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-20 20:45:24 +1000 |
commit | 8b5086250aa5dae8de8b763408ff480d7beac819 (patch) | |
tree | 781d7cac5662704a19c528dc590629c5382908b5 /mi | |
parent | c7987660fd665f32406b14db7078a3f5f7b76e9c (diff) |
Eliminate bogus event resizing.
Now that all event queues hold internal events only, they never need
to be resized. Resizing them led to memory corruption as they would
get sized for an appropriate xEvent, not an internal event.
Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'mi')
-rw-r--r-- | mi/mi.h | 4 | ||||
-rw-r--r-- | mi/mieq.c | 21 |
2 files changed, 14 insertions, 11 deletions
@@ -196,9 +196,7 @@ extern _X_EXPORT Bool mieqInit( void ); -extern _X_EXPORT void mieqResizeEvents( - int /* min_size */ -); +extern _X_EXPORT void mieqFini(void); extern _X_EXPORT void mieqEnqueue( DeviceIntPtr /*pDev*/, @@ -110,24 +110,29 @@ mieqInit(void) miEventQueue.handlers[i] = NULL; for (i = 0; i < QUEUE_SIZE; i++) { - EventListPtr evlist = InitEventList(1); - if (!evlist) - FatalError("Could not allocate event queue.\n"); - miEventQueue.events[i].events = evlist; + if (miEventQueue.events[i].events == NULL) { + EventListPtr evlist = InitEventList(1); + if (!evlist) + FatalError("Could not allocate event queue.\n"); + miEventQueue.events[i].events = evlist; + } } SetInputCheck(&miEventQueue.head, &miEventQueue.tail); return TRUE; } -/* Ensure all events in the EQ are at least size bytes. */ void -mieqResizeEvents(int min_size) +mieqFini(void) { int i; - for (i = 0; i < QUEUE_SIZE; i++) - SetMinimumEventSize(miEventQueue.events[i].events, 1, min_size); + { + if (miEventQueue.events[i].events != NULL) { + FreeEventList(miEventQueue.events[i].events, 1); + miEventQueue.events[i].events = NULL; + } + } } /* |