summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2021-06-23 19:26:07 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-06-25 05:23:05 +0000
commitd8d02172a12a6cd2f66aee9c90b6f0ef85221e92 (patch)
treeb6fa772e78cd803c5abc1fd973f23ae0cee4877f /src
parent2b84f40cd2493ff4f4e5daadb05864a5249d95d1 (diff)
Fix crashes on profile clearHttpCache
Destorying profile while clearCahceHttp is running ends badly. Fix issue reported by address sanitizer: ================================================================= ==561623==ERROR: AddressSanitizer: global-buffer-overflow on address .... #0 content::BrowserContext::GetBrowsingDataRemover(content::BrowserContext*) #1 QtWebEngineCore::ProfileIODataQt::removeBrowsingDataRemoverObserver() #2 QtWebEngineCore::BrowsingDataRemoverObserverQt::OnBrowsingDataRemoverDone(unsigned long) #3 ontent::BrowsingDataRemoverImpl::~BrowsingDataRemoverImpl() #5 std::default_delete<base::SupportsUserData::Data>::operator()(base::SupportsUserData::Data*) =================================================================== Change-Id: Ic021a5e4a0a841f3528cd77952493f4a627b81a6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit a5e627160cf9a05ce0dd92e541d44b1861eb84c0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/core/profile_io_data_qt.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/profile_io_data_qt.cpp b/src/core/profile_io_data_qt.cpp
index 8e6c8fed3..e22bac225 100644
--- a/src/core/profile_io_data_qt.cpp
+++ b/src/core/profile_io_data_qt.cpp
@@ -102,6 +102,12 @@ void ProfileIODataQt::shutdownOnUIThread()
qWarning() << "Could not delete ProfileIODataQt on io thread !";
delete this;
}
+ if (m_clearHttpCacheInProgress) {
+ m_clearHttpCacheInProgress = false;
+ content::BrowsingDataRemover *remover =
+ content::BrowserContext::GetBrowsingDataRemover(m_profileAdapter->profile());
+ remover->RemoveObserver(&m_removerObserver);
+ }
}
content::ResourceContext *ProfileIODataQt::resourceContext()