Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
5.7.0
-
None
-
5
-
81d55f772 (dev), ca3fa76a4 (6.8), 746c1b611 (6.7), 150b856f0 (tqtc/lts-6.5)
-
Foundation Sprint 104, Foundation Sprint 105, Foundation Sprint 106, Foundation Sprint 115
Description
Calling "QFileDialog::getOpenFileName" and then deleting the parent given to this function will crash Qt on Windows 10 64-bit.
I suspect the reason is similar to: https://blogs.kde.org/2009/03/26/how-crash-almost-every-qtkde-application-and-how-fix-it-0
Update
In case it helps, this will easily reproduce the crash:
int main(int argc, char **argv) { QApplication application{argc, argv}; QMainWindow *main_window = new QMainWindow(); main_window->show(); QPushButton *button = new QPushButton("Press me"); main_window->setCentralWidget(button); QObject::connect(button, &QPushButton::clicked, [main_window]() { QTimer::singleShot(2000, [main_window]() { delete main_window; }); QFileDialog::getOpenFileName(main_window, "Close me fast or I will crash!"); }); application.exec(); return 0; }
Attachments
Issue Links
- relates to
-
QTBUG-48414 QFileDialog::getOpenFileNames crashes or hangs on a sandbox
- Reported
-
QTBUG-22012 getOpenFileName() crashes the app under Irix 6.5
- Closed
-
QTBUG-45634 (QT 5.1) QFileDialog::getOpenFileName(s) crashes on OSX Yosemite 10.10.3
- Closed
-
QTBUG-47408 QFileDialog::getOpenFileName crashes if mounting a disk
- Closed
-
QTBUG-58167 QFileDialogPrivate crashes on QEvent::LanguageChange event
- Closed
-
QTBUG-33119 QFileDialog::getOpenFileNames causes crash on Win7 x64
- Closed