Fix crash when emitting render-view-deleted event

This commit is contained in:
Cheng Zhao 2017-08-29 17:46:46 +09:00
parent 7f4b74f8c6
commit 0550a4a9b8

View file

@ -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_);