From 2fbe54472e10e42ceebed54cfb42b9b2384b7203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 20 Feb 2017 12:09:28 +0100 Subject: [PATCH] macOS: Retain foreign windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Regression after 89842b97d74d1, 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 Reviewed-by: Timur Pocheptsov --- src/plugins/platforms/cocoa/qcocoawindow.mm | 1 + 1 file changed, 1 insertion(+) diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index 918f376446..60cababba4 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -472,6 +472,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw) if (tlw->type() == Qt::ForeignWindow) { m_view = (NSView *)WId(tlw->property("_q_foreignWinId").value()); + [m_view retain]; } else { m_view = [[QNSView alloc] initWithCocoaWindow:this]; // Enable high-dpi OpenGL for retina displays. Enabling has the side