From b6a12a53e33224112d0166581218e3840c1ed4ec Mon Sep 17 00:00:00 2001 From: Keeley Hammond Date: Mon, 13 Sep 2021 06:25:13 -0700 Subject: [PATCH] fix: delete rfh after open/save dialog done (#30916) --- shell/browser/file_select_helper.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/shell/browser/file_select_helper.cc b/shell/browser/file_select_helper.cc index 24f5019353..0b59c24677 100644 --- a/shell/browser/file_select_helper.cc +++ b/shell/browser/file_select_helper.cc @@ -183,6 +183,7 @@ void FileSelectHelper::OnOpenDialogDone(gin_helper::Dictionary result) { browser_context->prefs()->SetFilePath(prefs::kSelectFileLastDirectory, paths[0].DirName()); } + RunFileChooserEnd(); } } } @@ -214,6 +215,7 @@ void FileSelectHelper::OnSaveDialogDone(gin_helper::Dictionary result) { } // We should only call this if we have not cancelled the dialog. OnFilesSelected(std::move(file_info), base::FilePath()); + RunFileChooserEnd(); } } @@ -224,10 +226,6 @@ void FileSelectHelper::OnFilesSelected( listener_->FileSelected(std::move(file_info), base_dir, mode_); listener_.reset(); } - - render_frame_host_ = nullptr; - - delete this; } void FileSelectHelper::RenderWidgetHostDestroyed(