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/qcocoaintegration.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/qcocoaintegration.mm')
-rw-r--r-- | src/plugins/platforms/cocoa/qcocoaintegration.mm | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaintegration.mm b/src/plugins/platforms/cocoa/qcocoaintegration.mm index c8f6dd05db..04d5769044 100644 --- a/src/plugins/platforms/cocoa/qcocoaintegration.mm +++ b/src/plugins/platforms/cocoa/qcocoaintegration.mm @@ -33,7 +33,6 @@ #include "qcocoaintegration.h" -#include "qcocoaautoreleasepool.h" #include "qcocoawindow.h" #include "qcocoabackingstore.h" #include "qcocoanativeinterface.h" @@ -137,7 +136,7 @@ void QCocoaScreen::updateGeometry() qreal QCocoaScreen::devicePixelRatio() const { - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; NSScreen * screen = osScreen(); return qreal(screen ? [screen backingScaleFactor] : 1.0); } @@ -263,7 +262,7 @@ QCocoaIntegration::QCocoaIntegration() mInstance = this; initResources(); - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; qApp->setAttribute(Qt::AA_DontUseNativeMenuBar, false); @@ -314,7 +313,7 @@ QCocoaIntegration::~QCocoaIntegration() qt_resetNSApplicationSendEvent(); - QCocoaAutoReleasePool pool; + QMacAutoReleasePool pool; if (!QCoreApplication::testAttribute(Qt::AA_MacPluginApplication)) { // remove the apple event handlers installed by QCocoaApplicationDelegate QCocoaApplicationDelegate *delegate = [QCocoaApplicationDelegate sharedDelegate]; |