From e6b83b4600b86bd866aee6b797d9ab6a29c54a92 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 15 May 2018 19:01:14 +0200 Subject: Fix race condition on gpu thread initialization MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If browser io thread cleans up iself before gpu thread get fully initalize, it will end up in crash due to premature resourse release. Make sure the in_process_gpu_thread is started, before running thread termination. Task-number: QTBUG-68293 Change-Id: I2940c86aaacb8a9ab634b5cdae1c8614dda23b44 Reviewed-by: Jüri Valdmann --- chromium/content/browser/gpu/gpu_process_host.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chromium/content/browser/gpu/gpu_process_host.cc b/chromium/content/browser/gpu/gpu_process_host.cc index 8ed00b672ac..0e4ae429da5 100644 --- a/chromium/content/browser/gpu/gpu_process_host.cc +++ b/chromium/content/browser/gpu/gpu_process_host.cc @@ -683,6 +683,9 @@ GpuProcessHost::~GpuProcessHost() { } } + if (in_process_) + in_process_gpu_thread_->WaitUntilThreadStarted(); + // If there are any remaining offscreen contexts at the point the // GPU process exits, assume something went wrong, and block their // URLs from accessing client 3D APIs without prompting. -- cgit v1.2.3