diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-12-15 19:14:18 +0100 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2017-12-18 10:31:59 +0000 |
commit | 224acc295777ea2cf642842cebbd6df86ad2c888 (patch) | |
tree | 70885ff60afaac0d68121d5136f3fcfd91d083fc | |
parent | 3af56a2143e4fa3a10f93917ecde4ef46c2c807f (diff) | |
download | qtwebengine-chromium-224acc295777ea2cf642842cebbd6df86ad2c888.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.cc | 8 |
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 ac6f7065b38..e026a034ac5 100644 --- a/chromium/content/browser/gpu/gpu_process_host.cc +++ b/chromium/content/browser/gpu/gpu_process_host.cc @@ -386,6 +386,10 @@ GpuProcessHost* GpuProcessHost::Get(GpuProcessKind kind, bool force_create) { DCHECK(!service_manager::ServiceManagerIsRemote()); 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); @@ -398,10 +402,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; |