diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm index e7f8992c6d..4328487f63 100644 --- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm +++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.mm @@ -870,6 +870,9 @@ void QCocoaEventDispatcherPrivate::processPostedEvents() return; } + if (cleanupModalSessionsNeeded && currentExecIsNSAppRun) + cleanupModalSessions(); + if (processEventsCalled > 0 && interrupt) { if (currentExecIsNSAppRun) { // The event dispatcher has been interrupted. But since