aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/quickcontrols2/qquickiconimage.cpp7
-rw-r--r--src/quickcontrols2/qquickiconimage_p_p.h1
2 files changed, 8 insertions, 0 deletions
diff --git a/src/quickcontrols2/qquickiconimage.cpp b/src/quickcontrols2/qquickiconimage.cpp
index d86afd7f..11bb3bca 100644
--- a/src/quickcontrols2/qquickiconimage.cpp
+++ b/src/quickcontrols2/qquickiconimage.cpp
@@ -42,6 +42,12 @@
QT_BEGIN_NAMESPACE
+QQuickIconImagePrivate::~QQuickIconImagePrivate()
+{
+ qDeleteAll(icon.entries);
+ icon.entries.clear();
+}
+
bool QQuickIconImagePrivate::updateDevicePixelRatio(qreal targetDevicePixelRatio)
{
if (isThemeIcon) {
@@ -132,6 +138,7 @@ void QQuickIconImage::setName(const QString &name)
if (d->icon.iconName == name)
return;
+ qDeleteAll(d->icon.entries);
d->icon = QIconLoader::instance()->loadIcon(name);
if (isComponentComplete())
d->updateIcon();
diff --git a/src/quickcontrols2/qquickiconimage_p_p.h b/src/quickcontrols2/qquickiconimage_p_p.h
index 0c755ff6..11bf5e92 100644
--- a/src/quickcontrols2/qquickiconimage_p_p.h
+++ b/src/quickcontrols2/qquickiconimage_p_p.h
@@ -59,6 +59,7 @@ class Q_QUICKCONTROLS2_PRIVATE_EXPORT QQuickIconImagePrivate : public QQuickImag
Q_DECLARE_PUBLIC(QQuickIconImage)
public:
+ ~QQuickIconImagePrivate() override;
void updateIcon();
void updateFillMode();
qreal calculateDevicePixelRatio() const;