chore: call ListenerDestroyed()
in FileSelectHelper::RunFileChooserEnd()
(#37006)
chore: call ListenerDestroyed() in FileSelectHelper::RunFileChooserEnd()
This commit is contained in:
parent
86f99e9cf0
commit
afca3ff965
1 changed files with 6 additions and 3 deletions
|
@ -180,7 +180,7 @@ void FileSelectHelper::OnListDone(int error) {
|
|||
std::unique_ptr<ActiveDirectoryEnumeration> entry =
|
||||
std::move(directory_enumeration_);
|
||||
if (error) {
|
||||
FileSelectionCanceled(NULL);
|
||||
FileSelectionCanceled(nullptr);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -487,6 +487,11 @@ void FileSelectHelper::RunFileChooserEnd() {
|
|||
listener_->FileSelectionCanceled();
|
||||
render_frame_host_ = nullptr;
|
||||
web_contents_ = nullptr;
|
||||
// If the dialog was actually opened, dispose of our reference.
|
||||
if (select_file_dialog_) {
|
||||
select_file_dialog_->ListenerDestroyed();
|
||||
select_file_dialog_.reset();
|
||||
}
|
||||
Release();
|
||||
}
|
||||
|
||||
|
@ -525,8 +530,6 @@ void FileSelectHelper::RenderWidgetHostDestroyed(
|
|||
void FileSelectHelper::RenderFrameHostChanged(
|
||||
content::RenderFrameHost* old_host,
|
||||
content::RenderFrameHost* new_host) {
|
||||
if (!render_frame_host_)
|
||||
return;
|
||||
// The |old_host| and its children are now pending deletion. Do not give them
|
||||
// file access past this point.
|
||||
for (content::RenderFrameHost* host = render_frame_host_; host;
|
||||
|
|
Loading…
Reference in a new issue