We've been working for a while on adding JCEF to our app. We're 1 bug away from releasing it.
When the app is being shut down, if a browser instance was created previously, a crash will happen within Chromium, on macOS only.
Would you have any idea about what could be causing it ? I checked a bit the chromium code on the version we're using (official Spotify release build) and that scenario isn't supposed to happen, there's even a `DCHECK()` there...
Thanks!
Our shutdown code (Java):
- Code: Select all
public void destroy() {
this.cefClient.dispose();
this.cefApp.dispose();
long start = System.currentTimeMillis();
int i = 0;
while (CefManager.openedBrowsers != 0) {
if (System.currentTimeMillis() - start > 1_000) {
CefManager.LOGGER.info("Failed to clean up before timeout. Pumped events {} times", i);
return;
}
this.doEvents();
i++;
}
CefManager.LOGGER.info("Cleanup successful");
}
Stack trace with symbols:
- Code: Select all
content::SiteInstanceImpl::GetProcess() (in Chromium Embedded Framework) (site_instance_impl.cc:436)
content::SiteInstanceImpl::GetProcess() (in Chromium Embedded Framework) (site_instance_impl.cc:436)
content::ServiceWorkerProcessManager::Shutdown() (in Chromium Embedded Framework) (service_worker_process_manager.cc:60)
content::ServiceWorkerContextWrapper::Shutdown() (in Chromium Embedded Framework) (service_worker_context_wrapper.cc:335)
content::StoragePartitionImpl::OnBrowserContextWillBeDestroyed() (in Chromium Embedded Framework) (storage_partition_impl.cc:1243)
content::StoragePartitionImplMap::ForEach(base::FunctionRef<void (content::StoragePartition*)>) (in Chromium Embedded Framework) (storage_partition_impl_map.cc:440)
content::BrowserContextImpl::NotifyWillBeDestroyed() (in Chromium Embedded Framework) (browser_context_impl.cc:0)
Profile::MaybeSendDestroyedNotification() (in Chromium Embedded Framework) (profile.cc:499)
AlloyBrowserContext::Shutdown() (in Chromium Embedded Framework) (alloy_browser_context.cc:195)
CefBrowserContext::RemoveCefRequestContext(CefRequestContextImpl*) (in Chromium Embedded Framework) (browser_context.cc:249)
CefRequestContextImpl::~CefRequestContextImpl() (in Chromium Embedded Framework) (request_context_impl.cc:171)
CefRequestContextImpl::~CefRequestContextImpl() (in Chromium Embedded Framework) (request_context_impl.cc:163)
CefRequestContextImpl::~CefRequestContextImpl() (in Chromium Embedded Framework) (request_context_impl.cc:171)
CefRequestContextImpl::~CefRequestContextImpl() (in Chromium Embedded Framework) (request_context_impl.cc:163)
CefRequestContextImpl::Release() const (in Chromium Embedded Framework) (request_context_impl.h:228)
content::BrowserMainLoop::ShutdownThreadsAndCleanUp() (in Chromium Embedded Framework) (browser_main_loop.cc:0)
content::BrowserMainRunnerImpl::Shutdown() (in Chromium Embedded Framework) (browser_main_runner_impl.cc:196)
CefMainRunner::Shutdown(base::OnceCallback<void ()>, base::OnceCallback<void ()>) (in Chromium Embedded Framework) (main_runner.cc:333)
CefShutdown() (in Chromium Embedded Framework) (context.cc:365)