session: dont attach download dialog to deleted webContents window

This commit is contained in:
deepak1556 2016-04-27 20:00:31 +05:30
parent 0fa92923da
commit 46208b5b3e
2 changed files with 4 additions and 2 deletions

View file

@ -315,7 +315,7 @@ void Session::OnDownloadCreated(content::DownloadManager* manager,
bool prevent_default = Emit(
"will-download",
DownloadItem::Create(isolate(), item),
api::WebContents::CreateFrom(isolate(), web_contents));
web_contents);
if (prevent_default) {
item->Cancel(true);
item->Remove();