summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qicon.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel/qicon.cpp')
-rw-r--r--src/widgets/kernel/qicon.cpp14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/widgets/kernel/qicon.cpp b/src/widgets/kernel/qicon.cpp
index bb9f56b715..73f8a2a360 100644
--- a/src/widgets/kernel/qicon.cpp
+++ b/src/widgets/kernel/qicon.cpp
@@ -107,8 +107,18 @@ QT_BEGIN_NAMESPACE
static QBasicAtomicInt serialNumCounter = Q_BASIC_ATOMIC_INITIALIZER(1);
static void qt_cleanup_icon_cache();
-typedef QCache<QString, QIcon> IconCache;
-Q_GLOBAL_STATIC_WITH_INITIALIZER(IconCache, qtIconCache, qAddPostRoutine(qt_cleanup_icon_cache))
+namespace {
+ struct IconCache : public QCache<QString, QIcon>
+ {
+ IconCache()
+ {
+ // ### note: won't readd if QApplication is re-created!
+ qAddPostRoutine(qt_cleanup_icon_cache);
+ }
+ };
+}
+
+Q_GLOBAL_STATIC(IconCache, qtIconCache)
static void qt_cleanup_icon_cache()
{