mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
chore: call ListenerDestroyed() in FileSelectHelper::RunFileChooserEnd() (#37006)
chore: call ListenerDestroyed() in FileSelectHelper::RunFileChooserEnd()
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user