summaryrefslogtreecommitdiffstats
path: root/src/core/profile_qt.cpp
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-02-15 08:40:24 +0100
committerMichal Klocek <michal.klocek@qt.io>2021-02-16 23:56:46 +0100
commit827cbb1ff490b6b2da3bf71c6adac0956a6c3261 (patch)
treeb19bb28a55c1a8b4185938880456d3d43e9fd576 /src/core/profile_qt.cpp
parent1a2db07cac97db7c3609cf223e807fa62e178a9f (diff)
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 <allan.jensen@qt.io>
Diffstat (limited to 'src/core/profile_qt.cpp')
-rw-r--r--src/core/profile_qt.cpp1
1 files changed, 1 insertions, 0 deletions
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();