mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 04:40:48 +00:00
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.
This commit is contained in:
parent
9deb00bfdc
commit
761092a2fe
|
@ -171,10 +171,16 @@ - (void) signalEventAvailable
|
|||
|
||||
- (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 &&
|
||||
|
|
Loading…
Reference in a new issue