fix: crash in BrowserWindow destructor after win.webContents.destroy() (#18686)

This commit is contained in:
Milan Burda 2019-06-14 04:44:36 +02:00 committed by Cheng Zhao
parent da58ac7c20
commit 6e327184bd
4 changed files with 17 additions and 7 deletions

View file

@ -118,6 +118,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
static void BuildPrototype(v8::Isolate* isolate,
v8::Local<v8::FunctionTemplate> prototype);
base::WeakPtr<WebContents> GetWeakPtr() { return weak_factory_.GetWeakPtr(); }
// Destroy the managed content::WebContents instance.
//
// Note: The |async| should only be |true| when users are expecting to use the
@ -564,6 +566,8 @@ class WebContents : public mate::TrackableObject<WebContents>,
std::map<content::RenderFrameHost*, std::vector<mojo::BindingId>>
frame_to_bindings_map_;
base::WeakPtrFactory<WebContents> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(WebContents);
};