summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2017-12-15 19:14:18 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-01-22 12:46:29 +0100
commit252832be510aa0862608db51970caaa50db68cce (patch)
tree44d3583e02c07331d6749ac41d5f48c9f923c665
parent668a1a819743efce398194803b00f9fbb103a5a7 (diff)
downloadqtwebengine-chromium-252832be510aa0862608db51970caaa50db68cce.tar.gz
Fix hanging of process when application is closed too fast
What essentially happens is that the main thread is waiting for all other threads end, whereas an IO thread tries to recreate the in-process GPU thread, fails, tries again, fails and so on. The fix is to move the condition that checks that the application main loop has not finished, earlier. Task-number: QTBUG-65239 Change-Id: I5800d19b986657a249b1f672c95297d01f8dc11b Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--chromium/content/browser/gpu/gpu_process_host.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/chromium/content/browser/gpu/gpu_process_host.cc b/chromium/content/browser/gpu/gpu_process_host.cc
index 7bb099377d9..721a78bffb9 100644
--- a/chromium/content/browser/gpu/gpu_process_host.cc
+++ b/chromium/content/browser/gpu/gpu_process_host.cc
@@ -377,6 +377,10 @@ bool GpuProcessHost::ValidateHost(GpuProcessHost* host) {
GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind, bool force_create) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ // Do not create a new process if browser is shutting down.
+ if (BrowserMainRunner::ExitedMainMessageLoop())
+ return nullptr;
+
// Don't grant further access to GPU if it is not allowed.
GpuDataManagerImpl* gpu_data_manager = GpuDataManagerImpl::GetInstance();
DCHECK(gpu_data_manager);
@@ -389,10 +393,6 @@ GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind, bool force_create) {
if (!force_create)
return nullptr;
- // Do not create a new process if browser is shutting down.
- if (BrowserMainRunner::ExitedMainMessageLoop())
- return nullptr;
-
static int last_host_id = 0;
int host_id;
host_id = ++last_host_id;