summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@theqtcompany.com>2015-02-26 13:00:39 +0100
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2015-02-26 12:11:33 +0000
commit9608629d7ee42dd65437d2e7fad5c91438d7de4b (patch)
treeb2a26e31fcf0ec0b24c243a3b40ae7773f858dc5 /src/corelib/tools
parentb7d4e4ffebf91ff539e705abef9941073667f373 (diff)
OSX: fix leaks due to missing NSAutoreleasePool
env OBJC_DEBUG_MISSING_POOLS=YES qtcreator Change-Id: Ibbe5f42af5b94a439be3f0dd0f2b6e34bb1afd3f Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
Diffstat (limited to 'src/corelib/tools')
-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();