fix: avoid double free when destroying WebContents (#31104)

This commit is contained in:
Cheng Zhao 2021-09-27 16:20:55 +09:00 committed by GitHub
parent 1a6a8f55af
commit 2360012cad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 2 deletions

View file

@ -451,6 +451,9 @@ class WebContents : public gin::Wrappable<WebContents>,
WebContents(v8::Isolate* isolate, const gin_helper::Dictionary& options);
~WebContents() override;
// Delete this if garbage collection has not started.
void DeleteThisIfAlive();
// Creates a InspectableWebContents object and takes ownership of
// |web_contents|.
void InitWithWebContents(std::unique_ptr<content::WebContents> web_contents,