diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 708b9c902b7a..24a8f881b4e2 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -305,6 +305,10 @@ WebContents::WebContents(v8::Isolate* isolate, const mate::Dictionary& options) request_id_(0), background_throttling_(true), enable_devtools_(true) { + // WebContents may need to emit events when it is garbage collected, so it + // has to be deleted in the first gc callback. + MarkHighMemoryUsage(); + // Read options. options.Get("backgroundThrottling", &background_throttling_);