summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/core/profile_adapter.cpp3
-rw-r--r--src/core/profile_qt.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index 81c4f9809..dff98717d 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -121,6 +121,7 @@ ProfileAdapter::ProfileAdapter(const QString &storageName):
ProfileAdapter::~ProfileAdapter()
{
+ content::BrowserContext::NotifyWillBeDestroyed(m_profile.data());
while (!m_webContentsAdapterClients.isEmpty()) {
m_webContentsAdapterClients.first()->releaseProfile();
}
@@ -131,7 +132,9 @@ ProfileAdapter::~ProfileAdapter()
}
#if QT_CONFIG(ssl)
delete m_clientCertificateStore;
+ m_clientCertificateStore = nullptr;
#endif
+ WebEngineContext::flushMessages();
}
void ProfileAdapter::setStorageName(const QString &storageName)
diff --git a/src/core/profile_qt.cpp b/src/core/profile_qt.cpp
index dac6658e2..36303605f 100644
--- a/src/core/profile_qt.cpp
+++ b/src/core/profile_qt.cpp
@@ -111,8 +111,6 @@ 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();