summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qnswindow.mm8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qnswindow.mm b/src/plugins/platforms/cocoa/qnswindow.mm
index 96c0314769..f76934033c 100644
--- a/src/plugins/platforms/cocoa/qnswindow.mm
+++ b/src/plugins/platforms/cocoa/qnswindow.mm
@@ -114,6 +114,14 @@ static bool isMouseEvent(NSEvent *ev)
- (void)handleWindowEvent:(NSEvent *)theEvent
{
+ // We might get events for a NSWindow after the corresponding platform
+ // window has been deleted, as the NSWindow can outlive the QCocoaWindow
+ // e.g. if being retained by other parts of AppKit, or in an auto-release
+ // pool. We guard against this in QNSView as well, as not all callbacks
+ // come via events, but if they do there's no point in propagating them.
+ if (!self.platformWindow)
+ return;
+
[self.window superSendEvent:theEvent];
if (!self.platformWindow)