summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-04-21 17:16:22 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-05-02 19:02:07 +0000
commit60865878e44267cb036714a520b33e9a2078c452 (patch)
tree341b604aa1015ba959285d35ee5f01a61e52b364 /src/plugins
parent705c716543f2c318dc7b455d881fe0c8a6a467bf (diff)
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>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/cocoa/qcocoawindow.mm2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm
index b453da818f..b85fb97f67 100644
--- a/src/plugins/platforms/cocoa/qcocoawindow.mm
+++ b/src/plugins/platforms/cocoa/qcocoawindow.mm
@@ -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);