summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-04-20 16:41:39 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-05-12 11:47:15 +0000
commit942675f12b5052997f0cc6d9c908b92bd1a7d593 (patch)
tree6ef5aabce64639b0e92833da8ab3002a6b253b87
parentdf57011bdc30309960c8c4ef93b76633701d4bf3 (diff)
macOS: Guard on platform window instead of window delegate in QNSWindowHelper
The platform window is cleared in detachFromPlatformWindow, just like the delegate, but the platform window may be cleared due to other reasons as well, so use that as a guard before calling functions on the pw. Change-Id: Ie0773182073d4932b2bca8bc0fc8af24b8895a9d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index d963061ae9..b2a434b550 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -187,8 +187,8 @@ static void qt_closePopups()
if (!windowStillAlive)
return;
- if (!self.window.delegate)
- return; // Already detached, pending NSAppKitDefined event
+ if (!self.platformWindow)
+ return; // Platform window went away while processing event
if (pw && pw->frameStrutEventsEnabled() && isMouseEvent(theEvent)) {
NSPoint loc = [theEvent locationInWindow];