diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index cd777208f2..bf21503f6e 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -1601,9 +1601,8 @@ void QWidgetPrivate::deleteExtra() #endif if (extra->topextra) { deleteTLSysExtra(); - extra->topextra->backingStoreTracker.destroy(); + // extra->topextra->backingStore destroyed in QWidgetPrivate::deleteTLSysExtra() delete extra->topextra->icon; - delete extra->topextra->backingStore; delete extra->topextra; } delete extra; diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp index a7dd6bf01c..04bf0be27f 100644 --- a/src/widgets/kernel/qwidget_qpa.cpp +++ b/src/widgets/kernel/qwidget_qpa.cpp @@ -914,9 +914,13 @@ void QWidgetPrivate::deleteTLSysExtra() extra->topextra->window->destroy(); } setWinId(0); - //hmmm. should we delete window.. delete extra->topextra->window; extra->topextra->window = 0; + + extra->topextra->backingStoreTracker.destroy(); + delete extra->topextra->backingStore; + extra->topextra->backingStore = 0; + } }