aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2019-02-11 19:09:49 +0300
committerKonstantin Ritt <ritt.ks@gmail.com>2019-02-14 12:06:10 +0000
commit0614d792967b7721c692cb273bb5428544fa3680 (patch)
tree03a76b1463df448f277717728384cf20e136122e
parent579422faaad76b12341a725320da65fcabb3cf7b (diff)
QQuickTheme: make sure QQuickTheme instance gets destroyed before qApp
QFont data must not be held at the application destruction time to make the font database correctly dispose all acquired resources. Change-Id: Ifc4a28a89701cf5622e8289a688eb0d4344c81fd Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/quicktemplates2/qquicktheme.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquicktheme.cpp b/src/quicktemplates2/qquicktheme.cpp
index 1ea0cef2..af49ffc9 100644
--- a/src/quicktemplates2/qquicktheme.cpp
+++ b/src/quicktemplates2/qquicktheme.cpp
@@ -44,6 +44,18 @@ QT_BEGIN_NAMESPACE
QScopedPointer<QQuickTheme> QQuickThemePrivate::instance;
+static void cleanup_instance()
+{
+ QQuickThemePrivate::instance.reset();
+}
+
+static void install_instance_cleanuper()
+{
+ qAddPostRoutine(cleanup_instance);
+}
+
+Q_COREAPP_STARTUP_FUNCTION(install_instance_cleanuper)
+
static QPlatformTheme::Font platformFont(QQuickTheme::Scope scope)
{
switch (scope) {