clear pointer when WebContents is closed
This commit is contained in:
parent
51db1efb8a
commit
3b81312cf7
1 changed files with 6 additions and 3 deletions
|
@ -63,12 +63,15 @@ WebContentsView::WebContentsView(v8::Isolate* isolate,
|
||||||
}
|
}
|
||||||
|
|
||||||
WebContentsView::~WebContentsView() {
|
WebContentsView::~WebContentsView() {
|
||||||
|
if (api_web_contents_) {
|
||||||
api_web_contents_->RemoveObserver(this);
|
api_web_contents_->RemoveObserver(this);
|
||||||
api_web_contents_->DestroyWebContents(false /* async */);
|
api_web_contents_->DestroyWebContents(false /* async */);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void WebContentsView::OnCloseContents() {
|
void WebContentsView::OnCloseContents() {
|
||||||
// TODO(zcbenz): WebContents is closed, report the event.
|
api_web_contents_ = nullptr;
|
||||||
|
web_contents_.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
|
|
Loading…
Reference in a new issue