Commit 761092a2 authored by Ken Thomases's avatar Ken Thomases Committed by Alexandre Julliard

winemac: Clean up fully-delivered events in queues which aren't being drained.

Some events get queued for all GUI-connected threads but are only processed by the first to dequeue them. Other threads which tend their event queue discard such already-processed events. However, some threads may be connected to the GUI but never tend their event queue. To prevent such threads from accumulating zombie events, the zombies are cleared each time a new event is queued.
parent 9deb00bf
......@@ -171,10 +171,16 @@ static const OSType WineHotKeySignature = 'Wine';
- (void) postEventObject:(MacDrvEvent*)event
{
NSIndexSet* indexes;
MacDrvEvent* lastEvent;
[eventsLock lock];
indexes = [events indexesOfObjectsPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop){
return ((MacDrvEvent*)obj)->event->deliver <= 0;
}];
[events removeObjectsAtIndexes:indexes];
if ((event->event->type == MOUSE_MOVED ||
event->event->type == MOUSE_MOVED_ABSOLUTE) &&
event->event->deliver == INT_MAX &&
......
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