From 6dbf3576093858d981d8321b00f0b19faa7cf217 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 13 Oct 2017 16:27:13 +0200 Subject: Fix asserts and crashes in QWinEventNotifier activation loop The backwards iteration was done under the assumption that the only valid modification of the winEventNotifierList in a slot connected to activated() would be the removal of the notifier itself. This is wrong. Instead, iterate forwards, like before 85403d0a, and check the index against the current list size in every iteration. This ensures that we do not run out of bounds while the list is modified. Also, retry the activation loop if the list was modified by a slot connected to activated(). This ensures that all notifiers with signaled handles are activated. Task-number: QTBUG-65940 Change-Id: I25f305463b9234f391abc51fe0628d02f49b6931 Reviewed-by: Friedemann Kleint Reviewed-by: Oswald Buddenhagen --- src/corelib/kernel/qeventdispatcher_win_p.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/corelib/kernel/qeventdispatcher_win_p.h') diff --git a/src/corelib/kernel/qeventdispatcher_win_p.h b/src/corelib/kernel/qeventdispatcher_win_p.h index 683c7f8f36..a7ed8dda8a 100644 --- a/src/corelib/kernel/qeventdispatcher_win_p.h +++ b/src/corelib/kernel/qeventdispatcher_win_p.h @@ -195,6 +195,7 @@ public: HANDLE winEventNotifierActivatedEvent; QList winEventNotifierList; + bool winEventNotifierListModified = false; void activateEventNotifier(QWinEventNotifier * wen); QList queuedUserInputEvents; -- cgit v1.2.3