From 0614d792967b7721c692cb273bb5428544fa3680 Mon Sep 17 00:00:00 2001 From: Konstantin Ritt Date: Mon, 11 Feb 2019 19:09:49 +0300 Subject: 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 --- src/quicktemplates2/qquicktheme.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 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) { -- cgit v1.2.3