From f14b06e576855530e53e47ef0e29e0130a078b67 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Wed, 5 Feb 2014 16:10:50 +0100 Subject: Fix WebEngineContext not being ramped down in tests aboutToQuit is only emitted if QCoreApplication::exec is run, which isn't used by Qt's testlib. Register an application shutdown handler using qAddPostRoutine instead, which is going to be executed whenever the QCoreApplication is destroyed. Change-Id: Iec7d1e528dce79cbe7a73b450b2a0d2df793038a Reviewed-by: Pierre Rossi Reviewed-by: Andras Becsi --- src/core/web_engine_context.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/web_engine_context.cpp') diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 1e28c4ab8..193179ea1 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -94,7 +94,7 @@ scoped_refptr WebEngineContext::currentOrCreate(WebContentsAda if (!sContext) { sContext = new WebEngineContext(renderingMode); // Make sure that we ramp down Chromium before QApplication destroys its X connection, etc. - QObject::connect(qApp, &QCoreApplication::aboutToQuit, destroyContext); + qAddPostRoutine(destroyContext); } else if (renderingMode != sContext->renderingMode()) qFatal("Switching the QtWebEngine rendering mode once initialized in an application is not supported." " If you're using both a QQuickWebView and a QtQuick WebEngineView, make sure that the" -- cgit v1.2.3