summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qicon.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp
index 2b607ac5be..9c554dd513 100644
--- a/src/gui/image/qicon.cpp
+++ b/src/gui/image/qicon.cpp
@@ -1323,9 +1323,9 @@ QIcon QIcon::fromTheme(const QString &name)
bool hasUserTheme = QIconLoader::instance()->hasUserTheme();
QIconEngine * const engine = (platformTheme && !hasUserTheme) ? platformTheme->createIconEngine(name)
: new QIconLoaderEngine(name);
- QIcon *cachedIcon = new QIcon(engine);
- icon = *cachedIcon;
- qtIconCache()->insert(name, cachedIcon);
+ icon = QIcon(engine);
+ if (!icon.isNull())
+ qtIconCache()->insert(name, new QIcon(icon));
}
return icon;