diff options
author | Szabolcs David <davidsz@inf.u-szeged.hu> | 2022-12-19 16:59:44 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-01-17 19:53:30 +0000 |
commit | 073d8d2b736379c2641db1fc3fece8e52981204a (patch) | |
tree | cdeeef4d727b2ffe25e1219cf09beae40767ac03 | |
parent | 217e13fdff8dcec223ca9e654e1a4dbabb5c03f8 (diff) |
Fix crash in Quick when File System Access dialog accepted
The fileDialogListener was manually released (to avoid its fullscreen
blocking habit), but it doesn't exist if the file picker controller
was originated from the File System Access JS API. Move this operation
inside the proper condition to avoid crash.
Change-Id: Ife5a8451410f91350d280b41203523991f69774f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 5734c78ba87b8a6e1070e6a65777b5def0da581d)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/core/file_picker_controller.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/file_picker_controller.cpp b/src/core/file_picker_controller.cpp index f1b843e8a..1bfa0db20 100644 --- a/src/core/file_picker_controller.cpp +++ b/src/core/file_picker_controller.cpp @@ -198,6 +198,10 @@ void FilePickerController::filesSelectedInChooser(const QStringList &filesList) d_ptr->fileDialogListener->FileSelected( std::move(chooser_files), baseDir, static_cast<blink::mojom::FileChooserParams::Mode>(d_ptr->mode)); + + // release the fileSelectListener manually because it blocks fullscreen requests in chromium + // see QTBUG-106975 + d_ptr->fileDialogListener.reset(); } else if (d_ptr->fileSystemAccessDialogListener) { std::vector<base::FilePath> files; for (const auto &file : std::as_const(filesList)) { @@ -209,10 +213,6 @@ void FilePickerController::filesSelectedInChooser(const QStringList &filesList) else d_ptr->fileSystemAccessDialogListener->MultiFilesSelected(files, nullptr); } - - // release the fileSelectListener manually because it blocks fullscreen requests in chromium - // see QTBUG-106975 - d_ptr->fileDialogListener.reset(); } QStringList FilePickerController::acceptedMimeTypes() const |