diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 8408ff7085d808b0125f54a99acff88233743d1a..7cd7d485b69c995aabc8540e2b1f8fa4e15a844d 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -223,6 +223,11 @@ void WebEngineContext::destroy() // Flush the UI message loop before quitting. while (delegate->DoWork()) { } +#if QT_CONFIG(webengine_printing_and_pdf) + // Kill print job manager early as it has a content::NotificationRegistrar + m_printJobManager.reset(); +#endif + // Delete the global object and thus custom profiles m_defaultProfileAdapter.reset(); m_globalQObject.reset(); @@ -241,6 +246,10 @@ void WebEngineContext::destroy() // default BrowserContext might be used by the RenderprocessHostImpl's destructor. m_browserRunner.reset(); + // Destroying content-runner will force Chromium at_exit calls to run, and + // reap child processes. + m_contentRunner.reset(); + // Drop the false reference. m_handle->Release(); }