From 75deb740d5f7749a7b82dbf46767bc6b60b41401 Mon Sep 17 00:00:00 2001 From: "boliu@chromium.org" Date: Mon, 24 Jun 2013 20:19:18 +0000 Subject: cc: Fix incorrect LTHI shutdown logic Landing this fix for enne@. Original description by enne@: It's possible that if there has never been an activation (implying no root layer on the active tree), then the trees will not be cleared during LayerTreeHostImpl's destructor. Given the comment in the destructor about animation, this seems to be problematic enough. Issue 251722 is about a case where the tile manager tries to activate the tree during its destruction but because the trees haven't been cleared yet, it thinks this is a supported operation. This is fixed by always destroying the trees in the destructor. BUG=251722 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/16983013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208251 0039d316-1c4b-4281-b951-d872f2087c98 --- cc/trees/layer_tree_host_impl.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'cc') diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 4fe0871..316aeeb 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -227,15 +227,13 @@ LayerTreeHostImpl::~LayerTreeHostImpl() { input_handler_client_ = NULL; } - if (active_tree_->root_layer()) { - ClearRenderSurfaces(); - // The layer trees must be destroyed before the layer tree host. We've - // made a contract with our animation controllers that the registrar - // will outlive them, and we must make good. - recycle_tree_.reset(); - pending_tree_.reset(); - active_tree_.reset(); - } + ClearRenderSurfaces(); + // The layer trees must be destroyed before the layer tree host. We've + // made a contract with our animation controllers that the registrar + // will outlive them, and we must make good. + recycle_tree_.reset(); + pending_tree_.reset(); + active_tree_.reset(); } void LayerTreeHostImpl::BeginCommit() {} -- cgit v1.1