QFileDialog: disconnect nativeEnterDirectory in dtor
QIOSFileDialog emits directoryEntered from its hide/setVisible after QFileDialog is a QDialog already (in the process of destruction). This results in an ssert: "ASSERT failure in QFileDialog: "Called object is not of the correct type (class destructor may have already run)"", Fixes: QTBUG-130133 Change-Id: I8471a8434f7ea854a91b989bb3a6f3b962143ea8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de> (cherry picked from commit 2083daf79bc53a65a821e1cd3463638ac0c65f2e) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
993fa70777
commit
dc885e39c9
@ -373,10 +373,16 @@ QFileDialog::QFileDialog(const QFileDialogArgs &args)
|
||||
*/
|
||||
QFileDialog::~QFileDialog()
|
||||
{
|
||||
#if QT_CONFIG(settings)
|
||||
Q_D(QFileDialog);
|
||||
#if QT_CONFIG(settings)
|
||||
d->saveSettings();
|
||||
#endif
|
||||
if (QPlatformFileDialogHelper *platformHelper = d->platformFileDialogHelper()) {
|
||||
// QIOSFileDialog emits directoryChanged while hiding, causing an assert
|
||||
// because of a partially destroyed QFileDialog.
|
||||
QObjectPrivate::disconnect(platformHelper, &QPlatformFileDialogHelper::directoryEntered,
|
||||
d, &QFileDialogPrivate::nativeEnterDirectory);
|
||||
}
|
||||
}
|
||||
|
||||
/*!
|
||||
|
Loading…
x
Reference in New Issue
Block a user