From 76903100d72111c60fba0ea6b409cf5a16fb8612 Mon Sep 17 00:00:00 2001 From: fsamuel Date: Tue, 23 Jun 2015 09:55:15 -0700 Subject: [PATCH] Mandoline: CommandBufferSyncPointClientPtr was being destroyed on the wrong thread CommandBufferSyncPointClientPtr was being destroyed on the driver thread instead of the control thread which was causing all kinds of non-determistic behavior. The effect of this bug was exacerbated by ongoing support for multiple windows in Mandoline. BUG=496935 Review URL: https://codereview.chromium.org/1197313003 Cr-Commit-Position: refs/heads/master@{#335681} --- components/view_manager/gles2/command_buffer_impl.cc | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/view_manager/gles2/command_buffer_impl.cc b/components/view_manager/gles2/command_buffer_impl.cc index 174be5b61c62..059093e9ff0c 100644 --- a/components/view_manager/gles2/command_buffer_impl.cc +++ b/components/view_manager/gles2/command_buffer_impl.cc @@ -155,9 +155,14 @@ void CommandBufferImpl::BindToRequest( } void CommandBufferImpl::OnConnectionError() { - // OnConnectionError() is called on the background thread - // |control_task_runner| but objects we own (such as CommandBufferDriver) - // need to be destroyed on the thread we were created on. + // OnConnectionError() is called on the control thread |control_task_runner|. + // sync_point_client_ is assigned and accessed on the control thread and so it + // should also be destroyed on the control because InterfacePtrs are thread- + // hostile. + sync_point_client_.reset(); + + // Objects we own (such as CommandBufferDriver) need to be destroyed on the + // thread we were created on. driver_task_runner_->DeleteSoon(FROM_HERE, this); } -- 2.11.4.GIT