Commit 8f6fe913 authored by Allan Sandfeld Jensen's avatar Allan Sandfeld Jensen
Browse files

Cleaner shutdown


The print-job manager was trying to recreate a notification service, so
destroy it earlier, and at the same time kill the content runner before
existing WebEngineContext::destroy() to catch any other late
recreations of singletons.

Change-Id: Ifaa333386248c3dbc6d4f828c727a0a17d5f5c90
Reviewed-by: default avatarMichael Brüning <michael.bruning@qt.io>
Showing with 9 additions and 0 deletions
...@@ -223,6 +223,11 @@ void WebEngineContext::destroy() ...@@ -223,6 +223,11 @@ void WebEngineContext::destroy()
// Flush the UI message loop before quitting. // Flush the UI message loop before quitting.
while (delegate->DoWork()) { } 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 // Delete the global object and thus custom profiles
m_defaultProfileAdapter.reset(); m_defaultProfileAdapter.reset();
m_globalQObject.reset(); m_globalQObject.reset();
...@@ -241,6 +246,10 @@ void WebEngineContext::destroy() ...@@ -241,6 +246,10 @@ void WebEngineContext::destroy()
// default BrowserContext might be used by the RenderprocessHostImpl's destructor. // default BrowserContext might be used by the RenderprocessHostImpl's destructor.
m_browserRunner.reset(); 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. // Drop the false reference.
m_handle->Release(); m_handle->Release();
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment