From 14d189f7875b7def6f9745bfd20527a0fce19a44 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sun, 29 Nov 2015 21:08:26 +0100 Subject: [PATCH] AndroidStyle: use std::make_shared() More efficient, because control block and tracked object are co-located in a single memory allocation. Change-Id: Id18e2d06db43568eb34c2e2d129d1b116af73acb Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/plugins/platforms/android/qandroidplatformtheme.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/platforms/android/qandroidplatformtheme.cpp b/src/plugins/platforms/android/qandroidplatformtheme.cpp index 71a3f910d2..55bef1a1e8 100644 --- a/src/plugins/platforms/android/qandroidplatformtheme.cpp +++ b/src/plugins/platforms/android/qandroidplatformtheme.cpp @@ -218,7 +218,7 @@ QJsonObject AndroidStyle::loadStyleData() static std::shared_ptr loadAndroidStyle(QPalette *defaultPalette) { double pixelDensity = qEnvironmentVariableIsSet("QT_AUTO_SCREEN_SCALE_FACTOR") ? QtAndroid::pixelDensity() : 1.0; - std::shared_ptr style(new AndroidStyle); + std::shared_ptr style = std::make_shared(); style->m_styleData = AndroidStyle::loadStyleData(); if (style->m_styleData.isEmpty()) return std::shared_ptr();