diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/api/qtwebenginecoreglobal.cpp | 7 | ||||
-rw-r--r-- | src/core/api/qtwebenginecoreglobal_p.h | 1 | ||||
-rw-r--r-- | src/core/web_engine_context.cpp | 9 | ||||
-rw-r--r-- | src/core/web_engine_context.h | 3 |
4 files changed, 18 insertions, 2 deletions
diff --git a/src/core/api/qtwebenginecoreglobal.cpp b/src/core/api/qtwebenginecoreglobal.cpp index 5bf46f782..5215f7ce7 100644 --- a/src/core/api/qtwebenginecoreglobal.cpp +++ b/src/core/api/qtwebenginecoreglobal.cpp @@ -51,6 +51,7 @@ #endif #include <QThread> #include <QQuickWindow> +#include "web_engine_context.h" #if QT_CONFIG(opengl) QT_BEGIN_NAMESPACE @@ -206,6 +207,12 @@ Q_WEBENGINECORE_PRIVATE_EXPORT void initialize() #endif // QT_CONFIG(opengl) } + +bool closingDown() +{ + return WebEngineContext::closingDown(); +} + } // namespace QtWebEngineCore #if defined(Q_OS_WIN) diff --git a/src/core/api/qtwebenginecoreglobal_p.h b/src/core/api/qtwebenginecoreglobal_p.h index 8214fc19c..a716f5827 100644 --- a/src/core/api/qtwebenginecoreglobal_p.h +++ b/src/core/api/qtwebenginecoreglobal_p.h @@ -67,6 +67,7 @@ namespace QtWebEngineCore { Q_WEBENGINECORE_PRIVATE_EXPORT int processMain(int argc, const char **argv); +Q_WEBENGINECORE_PRIVATE_EXPORT bool closingDown(); } // namespace #if defined(Q_OS_WIN) namespace sandbox { diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index d11298b06..41aed57e2 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -384,7 +384,7 @@ static QStringList parseEnvCommandLine(const QString &cmdLine) scoped_refptr<QtWebEngineCore::WebEngineContext> WebEngineContext::m_handle; bool WebEngineContext::m_destroyed = false; - +bool WebEngineContext::m_closingDown = false; void WebEngineContext::destroyProfileAdapter() { if (content::RenderProcessHost::run_renderer_in_process()) { @@ -553,6 +553,7 @@ void WebEngineContext::destroyContextPostRoutine() // Destroy WebEngineContext before its static pointer is zeroed and destructor called. // Before destroying MessageLoop via destroying BrowserMainRunner destructor // WebEngineContext's pointer is used. + m_closingDown = true; m_handle->destroy(); #if !defined(NDEBUG) if (!m_handle->HasOneRef()) @@ -919,6 +920,11 @@ base::CommandLine* WebEngineContext::commandLine() { } } +bool WebEngineContext::closingDown() +{ + return m_closingDown; +} + } // namespace QT_BEGIN_NAMESPACE @@ -959,4 +965,5 @@ const char *qWebEngineChromiumSecurityPatchVersion() noexcept { return "92.0.4515.166"; // FIXME: Remember to update } + QT_END_NAMESPACE diff --git a/src/core/web_engine_context.h b/src/core/web_engine_context.h index accfa34e1..27eae95bf 100644 --- a/src/core/web_engine_context.h +++ b/src/core/web_engine_context.h @@ -105,7 +105,7 @@ public: static void destroyContextPostRoutine(); static ProxyAuthentication qProxyNetworkAuthentication(QString host, int port); static void flushMessages(); - + static bool closingDown(); ProfileAdapter *createDefaultProfileAdapter(); ProfileAdapter *defaultProfileAdapter(); @@ -158,6 +158,7 @@ private: #endif static scoped_refptr<QtWebEngineCore::WebEngineContext> m_handle; static bool m_destroyed; + static bool m_closingDown; static QAtomicPointer<gpu::SyncPointManager> s_syncPointManager; }; |