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() { |