Guard usage of m_cocoaPlatformWindow.
m_cocoaPlatformWindow is cleared when Qt is "done" with the QNSWindow or QNSPanel to prevent messages from Cocoa calling into possibly stale pointers. Change-Id: Id42b794fedbd3e597a0c4b50584cca976ba74c0f Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>bb10
parent
aa5f70c00a
commit
3f58fc00c9
|
|
@ -118,7 +118,7 @@ static bool isMouseEvent(NSEvent *ev)
|
|||
|
||||
// Windows with a transient parent (such as combobox popup windows)
|
||||
// cannot become the main window:
|
||||
if (m_cocoaPlatformWindow->window()->transientParent())
|
||||
if (m_cocoaPlatformWindow && m_cocoaPlatformWindow->window()->transientParent())
|
||||
canBecomeMain = NO;
|
||||
|
||||
return canBecomeMain;
|
||||
|
|
@ -155,6 +155,9 @@ static bool isMouseEvent(NSEvent *ev)
|
|||
|
||||
- (BOOL)canBecomeKeyWindow
|
||||
{
|
||||
if (!m_cocoaPlatformWindow)
|
||||
return NO;
|
||||
|
||||
// Only tool or dialog windows should become key:
|
||||
if (m_cocoaPlatformWindow->window()->type() == Qt::Tool || m_cocoaPlatformWindow->window()->type() == Qt::Dialog)
|
||||
return YES;
|
||||
|
|
|
|||
Loading…
Reference in New Issue