diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2024-04-02 18:00:00 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-04-03 19:20:54 +0000 |
commit | 52770791a5ef9163a0a70ab2b36cfdd54ccae6ed (patch) | |
tree | 1d0287a0d3ef27fe27d5b22242c7b901b54a9ab7 | |
parent | f78ddfac59a87172c553cee33e48ef1f880c35ed (diff) |
macOS: Remove popup mouse and app activation monitors on app shutdown
We're not guaranteed to get into any of the code paths that call
removePopupMonitor() before the app goes away. In a plugin-scenario,
this may cause crashes when our monitor then gets a callback and
we try to access QGuiApplicationPrivate::instance().
Pick-to: 6.5 6.2
Fixes: QTBUG-123959
Change-Id: I287b91ff261a8aab74adbbad8c63a042daf944d5
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit 8bb93bf8ee59b3e31e7353d6683dbb0aa890f7e7)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit fa92448dd60b8b0fded3abdc933308dd03432c6c)
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaintegration.mm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index 886326cd02..0ac1142f81 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -184,6 +184,9 @@ QCocoaIntegration::~QCocoaIntegration() [[NSApplication sharedApplication] setDelegate:nil]; } + // Stop global mouse event and app activation monitoring + QCocoaWindow::removePopupMonitor(); + #ifndef QT_NO_CLIPBOARD // Delete the clipboard integration and destroy mime type converters. // Deleting the clipboard integration flushes promised pastes using |