summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qlocale_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qlocale_mac.mm')
-rw-r--r--src/corelib/tools/qlocale_mac.mm13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/corelib/tools/qlocale_mac.mm b/src/corelib/tools/qlocale_mac.mm
index b581e33aef..37a63a2ca4 100644
--- a/src/corelib/tools/qlocale_mac.mm
+++ b/src/corelib/tools/qlocale_mac.mm
@@ -44,6 +44,18 @@
QT_BEGIN_NAMESPACE
+namespace {
+class AutoReleasePool
+{
+public:
+ AutoReleasePool(): pool([[NSAutoreleasePool alloc] init]) {}
+ ~AutoReleasePool() { [pool release]; }
+
+private:
+ NSAutoreleasePool *pool;
+};
+}
+
/******************************************************************************
** Wrappers for Mac locale system functions
*/
@@ -414,6 +426,7 @@ QLocale QSystemLocale::fallbackUiLocale() const
QVariant QSystemLocale::query(QueryType type, QVariant in = QVariant()) const
{
+ AutoReleasePool pool;
switch(type) {
// case Name:
// return getMacLocaleName();