From 547141352242f7f4eebc6814af7a5ea0f3dff5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 22 May 2015 14:01:59 +0200 Subject: 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 Reviewed-by: Simon Hausmann --- src/corelib/tools/qlocale_mac.mm | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'src/corelib/tools/qlocale_mac.mm') diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm index 37a63a2ca4..c0818f07d7 100644 --- a/src/corelib/tools/qlocale_mac.mm +++ b/src/corelib/tools/qlocale_mac.mm @@ -44,18 +44,6 @@ QT_BEGIN_NAMESPACE -namespace { -class AutoReleasePool -{ -public: - AutoReleasePool(): pool([[NSAutoreleasePool alloc] init]) {} - ~AutoReleasePool() { [pool release]; } - -private: - NSAutoreleasePool *pool; -}; -} - /****************************************************************************** ** Wrappers for Mac locale system functions */ @@ -426,7 +414,7 @@ QLocale QSystemLocale::fallbackUiLocale() const QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const { - AutoReleasePool pool; + QMacAutoReleasePool pool; switch(type) { // case Name: // return getMacLocaleName(); -- cgit v1.2.3