aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickdialogbuttonbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates2/qquickdialogbuttonbox.cpp')
-rw-r--r--src/quicktemplates2/qquickdialogbuttonbox.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/quicktemplates2/qquickdialogbuttonbox.cpp b/src/quicktemplates2/qquickdialogbuttonbox.cpp
index a4197692e4..0c1c1cffac 100644
--- a/src/quicktemplates2/qquickdialogbuttonbox.cpp
+++ b/src/quicktemplates2/qquickdialogbuttonbox.cpp
@@ -497,6 +497,13 @@ QQuickDialogButtonBox::QQuickDialogButtonBox(QQuickItem *parent)
QQuickDialogButtonBox::~QQuickDialogButtonBox()
{
+ Q_D(QQuickDialogButtonBox);
+ // QQuickContainerPrivate does call this, but as our type information has already been
+ // destroyed by that point (since this destructor has already run), it won't call our
+ // implementation. So, we need to make sure our implementation is called. If we don't do this,
+ // the listener we installed on the contentItem won't get removed, possibly resulting in
+ // heap-use-after-frees.
+ contentItemChange(nullptr, d->contentItem);
}
/*!