diff options
author | Morten Johan Sørvig <morten.sorvig@theqtcompany.com> | 2015-05-11 21:56:57 +0200 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@theqtcompany.com> | 2015-05-13 11:42:53 +0000 |
commit | 7ffcf328c75ddfc93e45d35eef549adb474cbda1 (patch) | |
tree | 92364d0de056d48641d024036f9f9f4bb9f4e62a /src/plugins/platforms/cocoa/qcocoawindow.mm | |
parent | 406934a6323d37d879fa1ce4894a62635c2ec834 (diff) |
Remove QNSView from superview in ~QCocoaWindow()
A QNSView without a corresponding live QCocoaWindow
object is not in a valid state. Previously we would
call removeFromSuperview for child QWindows to avoid
having Cocoa send messages to the now invalid QNSView.
Do this for QWindows embedded in native Cocoa
hierarchies as well.
Change-Id: I49c6daef8ed061b3f40138fe9b4ce6be190f2fd0
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 3db3fc3547..cbe4227b63 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -415,7 +415,7 @@ QCocoaWindow::~QCocoaWindow() if (m_isNSWindowChild) { if (m_parentCocoaWindow) m_parentCocoaWindow->removeChildWindow(this); - } else if (parent()) { + } else if ([m_contentView superview]) { [m_contentView removeFromSuperview]; } |