macOS: Add autorelease-pool when recreating NSWindow

Significantly reduces the number of objects left to rot in the root pool,
which is only drained on application shutdown.

Change-Id: Iad7520ab083715416d95413a63474b9153f22fb5
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Tor Arne Vestbø 2017-04-21 17:16:22 +02:00
parent 705c716543
commit 60865878e4

View File

@ -1556,6 +1556,8 @@ void QCocoaWindow::foreachChildNSWindow(void (^block)(QCocoaWindow *))
*/
void QCocoaWindow::recreateWindowIfNeeded()
{
QMacAutoReleasePool pool;
QPlatformWindow *parentWindow = QPlatformWindow::parent();
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::recreateWindowIfNeeded" << window()
<< "parent" << (parentWindow ? parentWindow->window() : 0);