Skip to content

Commit

Permalink
macOS: Add auto-release pool during QCocoaScreen::deliverUpdateReques…
Browse files Browse the repository at this point in the history
…ts()

Checking the application's keyWindow will autorelease the window, and
there's no root pool in place when called from the display-link thread.

Change-Id: Ic43164ad6397c92b858fb549f7a00e28b6110849
Reviewed-by: Morten Johan Sørvig <[email protected]>
Reviewed-by: Tor Arne Vestbø <[email protected]>
  • Loading branch information
torarnv committed Feb 12, 2019
1 parent 3850404 commit 81fd7f4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/plugins/platforms/cocoa/qcocoascreen.mm
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,8 @@ void flushOutput() {

void QCocoaScreen::deliverUpdateRequests()
{
QMacAutoReleasePool pool;

// The CVDisplayLink callback is a notification that it's a good time to produce a new frame.
// Since the callback is delivered on a separate thread we have to marshal it over to the
// main thread, as Qt requires update requests to be delivered there. This needs to happen
Expand Down

0 comments on commit 81fd7f4

Please sign in to comment.