macOS: Add explicit auto-release pool for requestActivateWindow

The API is often called from main before entering the event loop,
and the making the window first responder and key will autorelease
both the window and view.

Change-Id: Ie2a7dc14652015cbe802b57696e4a82d564e2dc0
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
bb10
Tor Arne Vestbø 2019-02-12 13:55:52 +01:00
parent c4e9eabc30
commit 6b8610f4e8
1 changed files with 3 additions and 3 deletions

View File

@ -1512,9 +1512,9 @@ void QCocoaWindow::deliverUpdateRequest()
void QCocoaWindow::requestActivateWindow()
{
NSWindow *window = [m_view window];
[window makeFirstResponder:m_view];
[window makeKeyWindow];
QMacAutoReleasePool pool;
[m_view.window makeFirstResponder:m_view];
[m_view.window makeKeyWindow];
}
QCocoaNSWindow *QCocoaWindow::createNSWindow(bool shouldBePanel)