summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-10-22 19:29:32 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2018-10-26 08:54:23 +0000
commitacf5c37046944d6483cfc68b3d877b015292d415 (patch)
treea3f37d92d63af67d44074665ef2f58f1f3e93916 /src
parentd555327a57cb1419fbc19c7dd0b12f6c845598a5 (diff)
macOS: Add local auto-release pool during updating of window flags
Prevents no-longer used QNSWindows from staying around (closed and invisible, but alive), due to being auto-released when there is no pool in place (during main(), before exec). Change-Id: I4eb63c7140290ffe6bded8a76732354c846ed579 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index 98e48a8b70..a28bdd628b 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -541,6 +541,12 @@ void QCocoaWindow::setWindowZoomButton(Qt::WindowFlags flags)
void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags)
{
+ // Updating the window flags may affect the window's theme frame, which
+ // in the process retains and then autoreleases the NSWindow. To make
+ // sure this doesn't leave lingering releases when there is no pool in
+ // place (e.g. during main(), before exec), we add one locally here.
+ QMacAutoReleasePool pool;
+
if (!isContentView())
return;