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>
This commit is contained in:
Tor Arne Vestbø 2018-10-22 19:29:32 +02:00
parent d555327a57
commit acf5c37046

View File

@ -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;