Skip to content

Commit

Permalink
macOS: Add autorelease-pool when recreating NSWindow
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
torarnv committed May 2, 2017
1 parent 705c716 commit 6086587
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/platforms/cocoa/qcocoawindow.mm
Original file line number Diff line number Diff line change
Expand Up @@ -1556,6 +1556,8 @@ Posted whenever an NSView object that has attached surfaces (that is,
*/
void QCocoaWindow::recreateWindowIfNeeded()
{
QMacAutoReleasePool pool;

QPlatformWindow *parentWindow = QPlatformWindow::parent();
qCDebug(lcQpaCocoaWindow) << "QCocoaWindow::recreateWindowIfNeeded" << window()
<< "parent" << (parentWindow ? parentWindow->window() : 0);
Expand Down

0 comments on commit 6086587

Please sign in to comment.