From 56fadb571f32b721d8b99554e6e38692009ec37f Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Thu, 28 Feb 2019 10:49:22 +0100 Subject: Force destruction of webcontent client before profile adapter Currently users might forget to delete webcontent client before profile adapter. This might be nasty if users are not aware of default profile. Instead of asserting badly in chromium, clean up and release chromium resources. This avoids the crash, but might leak memory if users never deletes page. Task-number: QTBUG-74021 Change-Id: I66f466f169d12f7ee08866d505260dca47800bb0 Reviewed-by: Allan Sandfeld Jensen --- src/core/profile_adapter.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/core/profile_adapter.h') diff --git a/src/core/profile_adapter.h b/src/core/profile_adapter.h index 9bc92b54a..7ed5c13f5 100644 --- a/src/core/profile_adapter.h +++ b/src/core/profile_adapter.h @@ -73,6 +73,7 @@ class DownloadManagerDelegateQt; class ProfileQt; class UserResourceControllerHost; class VisitedLinksManagerQt; +class WebContentsAdapterClient; class QWEBENGINECORE_PRIVATE_EXPORT ProfileAdapter : public QObject { @@ -127,6 +128,9 @@ public: void setSpellCheckEnabled(bool enabled); bool isSpellCheckEnabled() const; + void addWebContentsAdapterClient(WebContentsAdapterClient *client); + void removeWebContentsAdapterClient(WebContentsAdapterClient *client); + // KEEP IN SYNC with API or add mapping layer enum HttpCacheType { MemoryHttpCache = 0, @@ -211,6 +215,7 @@ private: VisitedLinksPolicy m_visitedLinksPolicy; QHash m_customUrlSchemeHandlers; QList m_clients; + QVector m_webContentsAdapterClients; int m_httpCacheMaxSize; Q_DISABLE_COPY(ProfileAdapter) -- cgit v1.2.3