From 827cbb1ff490b6b2da3bf71c6adac0956a6c3261 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 15 Feb 2021 08:40:24 +0100 Subject: Fix crashes on BrowserContext destruction When destroying WebEngineProile we send notifications like content::BrowserContext::NotifyWillBeDestroyed, this works well with global profile where there is no more render process around, moreover we still pump ui messages before we destroy profile. However, with user profiles we destruct BorwserContext and there can be still RenderProcessHost using it. Flush messages before running BrowserContext destructor. Change-Id: I4d8cda2bc1e2ae3dc0781bf3570a36db7d07223a Reviewed-by: Allan Sandfeld Jensen --- src/core/profile_qt.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/core/profile_qt.cpp') diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp index 748104312..dac6658e2 100644 --- a/src/core/profile_qt.cpp +++ b/src/core/profile_qt.cpp @@ -112,6 +112,7 @@ ProfileQt::~ProfileQt() DCHECK_CURRENTLY_ON(content::BrowserThread::UI); m_prefServiceAdapter.commit(); content::BrowserContext::NotifyWillBeDestroyed(this); + WebEngineContext::flushMessages(); BrowserContextDependencyManager::GetInstance()->DestroyBrowserContextServices(this); ShutdownStoragePartitions(); m_profileIOData->shutdownOnUIThread(); -- cgit v1.2.3