Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: ui/compositor/layer.cc

Issue 10919195: LayerAnimator must be prepared for its owning layer's deletion whenever it notifies observers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing the unit tests. Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/compositor/layer_animation_sequence.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer.cc
diff --git a/ui/compositor/layer.cc b/ui/compositor/layer.cc
index 7e7964900876cb70a32b835c53a83ef05d51e087..71daa33f74c9af71352b6bd8f0ed44a8292b9412 100644
--- a/ui/compositor/layer.cc
+++ b/ui/compositor/layer.cc
@@ -95,7 +95,9 @@ Layer::~Layer() {
// Destroying the animator may cause observers to use the layer (and
// indirectly the WebLayer). Destroy the animator first so that the WebLayer
// is still around.
- animator_.reset();
+ if (animator_)
+ animator_->SetDelegate(NULL);
+ animator_ = NULL;
if (compositor_)
compositor_->SetRootLayer(NULL);
if (parent_)
@@ -174,7 +176,7 @@ bool Layer::Contains(const Layer* other) const {
void Layer::SetAnimator(LayerAnimator* animator) {
if (animator)
animator->SetDelegate(this);
- animator_.reset(animator);
+ animator_ = animator;
}
LayerAnimator* Layer::GetAnimator() {
« no previous file with comments | « ui/compositor/layer.h ('k') | ui/compositor/layer_animation_sequence.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698