Don't load URL if web contents is destroyed

This commit is contained in:
Kevin Sawicki 2016-12-20 16:51:03 -08:00
parent 095f304d7d
commit 1308f790ad
2 changed files with 11 additions and 0 deletions

View file

@ -439,6 +439,11 @@ content::WebContents* WebContents::OpenURLFromTab(
if (Emit("will-navigate", params.url))
return nullptr;
// Don't load the URL if the web contents was marked as destroyed from a
// will-navigate event listener
if (IsDestroyed())
return nullptr;
return CommonWebContentsDelegate::OpenURLFromTab(source, params);
}