diff options
Diffstat (limited to 'src/widgets/kernel/qwidget.cpp')
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index cdea0a570c..68ce8d5d15 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -121,6 +121,8 @@ #include <QtPlatformHeaders/qxcbwindowfunctions.h> +#include <private/qmemory_p.h> + // widget/widget data creation count //#define QWIDGET_EXTRA_DEBUG //#define ALIEN_DEBUG @@ -1784,7 +1786,6 @@ void QWidgetPrivate::createTLExtra() createExtra(); if (!extra->topextra) { QTLWExtra* x = extra->topextra = new QTLWExtra; - x->icon = 0; x->backingStore = 0; x->sharedPainter = 0; x->incw = x->inch = 0; @@ -1872,7 +1873,6 @@ void QWidgetPrivate::deleteExtra() if (extra->topextra) { deleteTLSysExtra(); // extra->topextra->backingStore destroyed in QWidgetPrivate::deleteTLSysExtra() - delete extra->topextra->icon; delete extra->topextra; } delete extra; @@ -1902,7 +1902,6 @@ void QWidgetPrivate::deleteTLSysExtra() extra->topextra->backingStoreTracker.destroy(); deleteBackingStore(this); #ifndef QT_NO_OPENGL - qDeleteAll(extra->topextra->widgetTextures); extra->topextra->widgetTextures.clear(); delete extra->topextra->shareContext; extra->topextra->shareContext = 0; @@ -6266,8 +6265,9 @@ void QWidget::setWindowIcon(const QIcon &icon) d->createTLExtra(); if (!d->extra->topextra->icon) - d->extra->topextra->icon = new QIcon(); - *d->extra->topextra->icon = icon; + d->extra->topextra->icon = qt_make_unique<QIcon>(icon); + else + *d->extra->topextra->icon = icon; d->setWindowIcon_sys(); d->setWindowIcon_helper(); |