summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-04-21 16:09:05 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2017-05-02 19:01:59 +0000
commit705c716543f2c318dc7b455d881fe0c8a6a467bf (patch)
tree0ca0a0ed3039c87222e48706a67b99c3ff5ee93e /src/corelib/kernel
parente4cb8c881f4c5e99de50a811d6cc7dd911baaa5e (diff)
macOS: Add auto-release pools for Q*ApplicationPrivate::init()
So that any objects autoreleased during application initialization are released. Otherwise they will end up in the root level pool and only be released when the application exits and the application goes out of scope. Change-Id: If02d24fd70098f9b4b1b0ea3218e0a15e438b9db Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/corelib/kernel')
-rw-r--r--src/corelib/kernel/qcoreapplication.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
index cc8375298d..0104ba0101 100644
--- a/src/corelib/kernel/qcoreapplication.cpp
+++ b/src/corelib/kernel/qcoreapplication.cpp
@@ -758,6 +758,10 @@ QCoreApplication::QCoreApplication(int &argc, char **argv
void QCoreApplicationPrivate::init()
{
+#if defined(Q_OS_MACOS)
+ QMacAutoReleasePool pool;
+#endif
+
Q_Q(QCoreApplication);
initLocale();