I would like to be tested for one simple fix. This is the situation after the renderer process terminated abnormally.
Reference file : cef/libcef/browser/browser_host_impl.cc
My project is matched with one gl surface per renderer process. It is also an embedded environment.
So to destroy one surface, Browser call API(brower->GetHost()->CloseBrowser(true)) through IPC message from the system.
In normal case, there was no problem at all. because browser call the `CloseBrowser` API. However, in an abnormal termination situation, the surface is not terminated.
because platform_delegate_.reset(NULL) which is a process within the CefBrowserHostImpl::DestroyBrowser(), is not called.
In addition, the resources associated with the renderer process seem to be not released.
While i was looking for a way, I notice that CefBrowserHostImpl::RenderProcessGone is called when the renderer process terminates abnormally.
So i inserted the following code to destroy the resources and surfaces associated with the renderer process when the function is called.
- Code: Select all
void CefBrowserHostImpl::RenderProcessGone(base::TerminationStatus status) {
...
if (client_.get()) {
CefRefPtr<CefRequestHandler> handler = client_->GetRequestHandler();
if (handler.get()) {
std::unique_ptr<NavigationLock> navigation_lock = CreateNavigationLock();
handler->OnRenderProcessTerminated(this, ts);
CEF_POST_TASK(CEF_UIT,
base::Bind(&CefBrowserHostImpl::CloseBrowser, this, true));
}
}
}
Is this code likely to cause other problems?