diff options
author | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-05-22 14:01:59 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> | 2015-05-27 18:45:29 +0000 |
commit | 547141352242f7f4eebc6814af7a5ea0f3dff5f8 (patch) | |
tree | ae99a717d91c073653426e16d01fa4767857ff66 /src/plugins/platforms/cocoa/qcocoawindow.mm | |
parent | 5f21aa22fbc224cdd4102ae6a7797574a463af3b (diff) |
Add shared implementation of a NSAutoreleasePool wrapper to qglobal
We have at least 5 different (but equal) implementations of a wrapper
in Qt, and some code uses explicit NSAutoreleasePools. Having a shared
implementation lets us clean up things a bit and makes it easier to
reason about which pools are actually needed.
Change-Id: I2fd8eefc3ae7308595ef9899b7820206268362a5
Reviewed-by: Tim Blechmann <tim@klingt.org>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoawindow.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoawindow.mm | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm index f6389a2096..8af0a71bc1 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm @@ -33,7 +33,6 @@ #include "qcocoawindow.h" #include "qcocoaintegration.h" #include "qnswindowdelegate.h" -#include "qcocoaautoreleasepool.h" #include "qcocoaeventdispatcher.h" #ifndef QT_NO_OPENGL #include "qcocoaglcontext.h" @@ -374,7 +373,7 @@ QCocoaWindow::QCocoaWindow(QWindow *tlw) #ifdef QT_COCOA_ENABLE_WINDOW_DEBUG qDebug() << "QCocoaWindow::QCocoaWindow" << this; #endif - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (tlw->type() == Qt::ForeignWindow) { NSView *foreignView = (NSView *)WId(tlw->property("_q_foreignWinId").value<WId>()); @@ -410,7 +409,7 @@ QCocoaWindow::~QCocoaWindow() qDebug() << "QCocoaWindow::~QCocoaWindow" << this; #endif - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; [m_nsWindow setContentView:nil]; [m_nsWindow.helper detachFromPlatformWindow]; if (m_isNSWindowChild) { @@ -492,7 +491,7 @@ QRect QCocoaWindow::geometry() const void QCocoaWindow::setCocoaGeometry(const QRect &rect) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (m_contentViewIsEmbedded) { QPlatformWindow::setGeometry(rect); @@ -616,7 +615,7 @@ void QCocoaWindow::setVisible(bool visible) m_inSetVisible = true; - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QCocoaWindow *parentCocoaWindow = 0; if (window()->transientParent()) parentCocoaWindow = static_cast<QCocoaWindow *>(window()->transientParent()->handle()); @@ -887,7 +886,7 @@ void QCocoaWindow::setWindowState(Qt::WindowState state) void QCocoaWindow::setWindowTitle(const QString &title) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (!m_nsWindow) return; @@ -898,7 +897,7 @@ void QCocoaWindow::setWindowTitle(const QString &title) void QCocoaWindow::setWindowFilePath(const QString &filePath) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (!m_nsWindow) return; @@ -908,7 +907,7 @@ void QCocoaWindow::setWindowFilePath(const QString &filePath) void QCocoaWindow::setWindowIcon(const QIcon &icon) { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; NSButton *iconButton = [m_nsWindow standardWindowButton:NSWindowDocumentIconButton]; if (iconButton == nil) { @@ -1026,7 +1025,7 @@ bool QCocoaWindow::isOpaque() const void QCocoaWindow::propagateSizeHints() { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (!m_nsWindow) return; @@ -1367,7 +1366,7 @@ bool QCocoaWindow::shouldUseNSPanel() QCocoaNSWindow * QCocoaWindow::createNSWindow() { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; QRect rect = initialGeometry(window(), window()->geometry(), defaultWindowWidth, defaultWindowHeight); NSRect frame = qt_mac_flipRect(rect); |