diff options
author | Dong Rui <dongrui@uniontech.com> | 2021-06-01 10:48:22 +0800 |
---|---|---|
committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2021-06-03 10:00:36 +0000 |
commit | af738780d3efea14733c5a3b5540fa715cd6bca6 (patch) | |
tree | 0dad7b3afe28aa05c65644587f497687c9a79fac /src/widgets | |
parent | ee66bfba39aa12419800ab9a342e470e224ea2eb (diff) |
QFileDialog::saveFileContent crashes on accept
When using QFileDialog::saveFileCOntent, there is a risk of crash.
Using deleteLater in the dialogClosed lambda in QFileDialog::saveFileContent
Pick-to: 5.15
Fixes: QTBUG-90442
Change-Id: I200ccda9d973af2fa9b6ce9d72a518b154ef2019
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/dialogs/qfiledialog.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index 931b8a69e3..74484b629d 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -2348,7 +2348,7 @@ void QFileDialog::getOpenFileContent(const QString &nameFilter, const std::funct auto dialogClosed = [=](int code) { Q_UNUSED(code); - delete dialog; + dialog->deleteLater(); }; connect(dialog, &QFileDialog::fileSelected, fileSelected); @@ -2393,7 +2393,7 @@ void QFileDialog::saveFileContent(const QByteArray &fileContent, const QString & auto dialogClosed = [=](int code) { Q_UNUSED(code); - delete dialog; + dialog->deleteLater(); }; connect(dialog, &QFileDialog::fileSelected, fileSelected); |