macOS: Retain foreign windows

Regression after 89842b97d7, where the retain was part of setView.

We release m_view in the destructor, regardless of how the view was
acquired, and the non-foreign window retains by being the one creating
the view.

Task-number: QTBUG-59001
Change-Id: I6d9621a63ea6ec2cee008986b0ab72ff61110ad7
Reviewed-by: René J.V. Bertin <rjvbertin@gmail.com>
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
bb10
Tor Arne Vestbø 2017-02-20 12:09:28 +01:00
parent 3e5d5852dd
commit 2fbe54472e
1 changed files with 1 additions and 0 deletions

View File

@ -472,6 +472,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw)
if (tlw->type() == Qt::ForeignWindow) {
m_view = (NSView *)WId(tlw->property("_q_foreignWinId").value<WId>());
[m_view retain];
} else {
m_view = [[QNSView alloc] initWithCocoaWindow:this];
// Enable high-dpi OpenGL for retina displays. Enabling has the side