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>
This commit is contained in:
Tor Arne Vestbø 2017-04-20 16:41:39 +02:00
parent df57011bdc
commit 942675f12b

View File

@ -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];