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>
This commit is contained in:
parent
ee66bfba39
commit
af738780d3
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user