Index: ui/gfx/compositor/layer_animator.cc |
diff --git a/ui/gfx/compositor/layer_animator.cc b/ui/gfx/compositor/layer_animator.cc |
index f98904cfd22c99c710f45b573da2cccc1e220266..a2008817ad4e5e39cca685b3439f590a059d7f03 100644 |
--- a/ui/gfx/compositor/layer_animator.cc |
+++ b/ui/gfx/compositor/layer_animator.cc |
@@ -393,9 +393,12 @@ void LayerAnimator::RemoveAllAnimationsWithACommonProperty( |
} |
void LayerAnimator::ImmediatelySetNewTarget(LayerAnimationSequence* sequence) { |
+ // Ensure that sequence is disposed of when this function completes. |
+ scoped_ptr<LayerAnimationSequence> to_dispose(sequence); |
const bool abort = false; |
RemoveAllAnimationsWithACommonProperty(sequence, abort); |
- scoped_ptr<LayerAnimationSequence> removed(RemoveAnimation(sequence)); |
+ LayerAnimationSequence* removed = RemoveAnimation(sequence); |
+ DCHECK(removed == NULL || removed == sequence); |
sequence->Progress(sequence->duration(), delegate()); |
} |