From 4ae8bb52c315f47b6ccecf705c51bb00ac7b9ad5 Mon Sep 17 00:00:00 2001 From: bridiver Date: Tue, 6 Sep 2016 14:16:19 -0700 Subject: [PATCH] destroy memory pressure listener if webcontents is destroyed possible fix for https://github.com/brave/browser-laptop/issues/3775 auditors @bbondy --- atom/browser/api/atom_api_web_contents.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 7b748428a..755d2bbf4 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -964,6 +964,7 @@ bool WebContents::OnMessageReceived(const IPC::Message& message) { // be destroyed on close, and WebContentsDestroyed would be called for it, so // we need to make sure the api::WebContents is also deleted. void WebContents::WebContentsDestroyed() { + memory_pressure_listener_.reset(); // clear out fullscreen state if (CommonWebContentsDelegate::IsFullscreenForTabOrPending(web_contents())) { ExitFullscreenModeForTab(web_contents());