From e864d8656c2682fc79a5affe789992de318c8f8a Mon Sep 17 00:00:00 2001
From: Michal Klocek <michal.klocek@qt.io>
Date: Tue, 30 Jan 2018 18:05:18 +0100
Subject: [PATCH] Shutdown storage in browser context adapter destructor

Shutdown storage should take place in destructor, otherwise
it might get recreated on web content destruction.

Task-number: QTBUG-66081
Change-Id: Ibba3fce50e05e09131cf45061320a9f99267babd
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
---
 src/core/browser_context_adapter.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/core/browser_context_adapter.cpp b/src/core/browser_context_adapter.cpp
index 41b5b1932..683b9c0d2 100644
--- a/src/core/browser_context_adapter.cpp
+++ b/src/core/browser_context_adapter.cpp
@@ -103,11 +103,11 @@ BrowserContextAdapter::BrowserContextAdapter(const QString &storageName)
 BrowserContextAdapter::~BrowserContextAdapter()
 {
     Q_ASSERT(!m_downloadManagerDelegate);
+    m_browserContext->ShutdownStoragePartitions();
 }
 
 void BrowserContextAdapter::shutdown()
 {
-    m_browserContext->ShutdownStoragePartitions();
     if (m_downloadManagerDelegate) {
         m_browserContext->GetDownloadManager(m_browserContext.data())->Shutdown();
         m_downloadManagerDelegate.reset();
-- 
GitLab