Fix nullref crash in RemoveGuest
This commit is contained in:
parent
85b0885af7
commit
3105092130
1 changed files with 10 additions and 6 deletions
|
@ -81,12 +81,16 @@ void WebViewManager::AddGuest(int guest_instance_id,
|
||||||
|
|
||||||
void WebViewManager::RemoveGuest(int guest_instance_id) {
|
void WebViewManager::RemoveGuest(int guest_instance_id) {
|
||||||
auto web_contents = web_contents_map_[guest_instance_id].web_contents;
|
auto web_contents = web_contents_map_[guest_instance_id].web_contents;
|
||||||
content::BrowserThread::PostTask(
|
|
||||||
content::BrowserThread::IO, FROM_HERE,
|
if (web_contents) {
|
||||||
base::Bind(
|
content::BrowserThread::PostTask(
|
||||||
&WebViewRendererState::RemoveGuest,
|
content::BrowserThread::IO, FROM_HERE,
|
||||||
base::Unretained(WebViewRendererState::GetInstance()),
|
base::Bind(
|
||||||
web_contents->GetRenderProcessHost()->GetID()));
|
&WebViewRendererState::RemoveGuest,
|
||||||
|
base::Unretained(WebViewRendererState::GetInstance()),
|
||||||
|
web_contents->GetRenderProcessHost()->GetID()));
|
||||||
|
}
|
||||||
|
|
||||||
web_contents_map_.erase(guest_instance_id);
|
web_contents_map_.erase(guest_instance_id);
|
||||||
|
|
||||||
// Remove the record of element in embedder too.
|
// Remove the record of element in embedder too.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue