Commit f6c57c76 authored by Joone Hur's avatar Joone Hur Committed by Commit Bot

Fix crash in SelectFileDialogImplGTK::OnFileChooserDestroyThunk.

Here is the call stack when the crash happens:
(chrome - scoped_refptr.h: 191)	libgtkui::SelectFileDialogImplGTK::OnFileChooserDestroyThunk(_GtkWidget*, void*)
(chrome - select_file_dialog_impl_gtk.cc: 98)	libgtkui::SelectFileDialogImplGTK::~SelectFileDialogImplGTK()
(chrome - select_file_dialog_impl_gtk.cc: 89)	<name omitted>
(chrome - ref_counted.h: 414)	DownloadFilePicker::~DownloadFilePicker()
(chrome - select_file_dialog_impl_gtk.cc: 284)	libgtkui::SelectFileDialogImplGTK::FileSelected(_GtkWidget*, base::FilePath const&)

A dialog is destroyed in FileSelected(), but it seems that the same
dialog is destroyed again in OnFileChooserDestroy.

BUG=880073

Change-Id: I1f47bbc26b4af81b4c73d7cf03ac684edc4f97fd
Reviewed-on: https://chromium-review.googlesource.com/1256020
Commit-Queue: Joone Hur <joone.hur@intel.com>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595612}
parent d6dbe19b
...@@ -532,6 +532,11 @@ void SelectFileDialogImplGTK::OnSelectMultiFileDialogResponse(GtkWidget* dialog, ...@@ -532,6 +532,11 @@ void SelectFileDialogImplGTK::OnSelectMultiFileDialogResponse(GtkWidget* dialog,
} }
void SelectFileDialogImplGTK::OnFileChooserDestroy(GtkWidget* dialog) { void SelectFileDialogImplGTK::OnFileChooserDestroy(GtkWidget* dialog) {
// There might be a case that |dialog| is already deleted
// in SelectFileDialogImplGTK::FileSelected.
// See https://crbug.com/880073.
if (!dialog)
return;
// |parent| can be nullptr when closing the host window // |parent| can be nullptr when closing the host window
// while opening the file-picker. // while opening the file-picker.
aura::Window* parent = dialogs_[dialog]->parent; aura::Window* parent = dialogs_[dialog]->parent;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment