fix crash when default download is canceled
authorRobo <hop2deep@gmail.com>
Mon, 1 Feb 2016 18:56:37 +0000 (00:26 +0530)
committerRobo <hop2deep@gmail.com>
Mon, 1 Feb 2016 18:56:37 +0000 (00:26 +0530)
atom/browser/api/atom_api_session.cc

index b903240..37909c5 100644 (file)
@@ -296,10 +296,8 @@ void Session::OnDownloadCreated(content::DownloadManager* manager,
       "will-download",
       DownloadItem::Create(isolate(), item),
       api::WebContents::CreateFrom(isolate(), web_contents));
-  if (prevent_default) {
+  if (prevent_default)
     item->Cancel(true);
-    item->Remove();
-  }
 }
 
 void Session::ResolveProxy(const GURL& url, ResolveProxyCallback callback) {