summaryrefslogtreecommitdiffstats
path: root/src/widgets
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/widgets
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/widgets')
-rw-r--r--src/widgets/kernel/qapplication.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 0e4ee30c19..4ab43628b9 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -564,6 +564,10 @@ QApplication::QApplication(int &argc, char **argv, int _internal)
*/
void QApplicationPrivate::init()
{
+#if defined(Q_OS_MACOS)
+ QMacAutoReleasePool pool;
+#endif
+
QGuiApplicationPrivate::init();
initResources();