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

Unified Diff: ui/compositor/layer_animation_observer.cc

Issue 10874064: Fixes crash introduced @ 153047 (you can hit crash by maximizing a (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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_animation_observer.h ('k') | ui/compositor/layer_animator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/compositor/layer_animation_observer.cc
diff --git a/ui/compositor/layer_animation_observer.cc b/ui/compositor/layer_animation_observer.cc
index b41676aef27376915e93978f5dc11660eb015ecf..a4bd5b423e6c74a90a8de0ea4da80c1bf34fbbae 100644
--- a/ui/compositor/layer_animation_observer.cc
+++ b/ui/compositor/layer_animation_observer.cc
@@ -56,10 +56,14 @@ void LayerAnimationObserver::DetachedFromSequence(
// ImplicitAnimationObserver
ImplicitAnimationObserver::ImplicitAnimationObserver()
- : active_(false) {
+ : active_(false),
+ destroyed_(NULL) {
}
-ImplicitAnimationObserver::~ImplicitAnimationObserver() {}
+ImplicitAnimationObserver::~ImplicitAnimationObserver() {
+ if (destroyed_)
+ *destroyed_ = true;
+}
void ImplicitAnimationObserver::SetActive(bool active) {
active_ = active;
@@ -73,7 +77,12 @@ void ImplicitAnimationObserver::StopObservingImplicitAnimations() {
void ImplicitAnimationObserver::OnLayerAnimationEnded(
LayerAnimationSequence* sequence) {
+ bool destroyed = false;
+ destroyed_ = &destroyed;
sequence->RemoveObserver(this);
+ if (destroyed)
+ return;
+ destroyed_ = NULL;
DCHECK(attached_sequences().find(sequence) == attached_sequences().end());
CheckCompleted();
}
« no previous file with comments | « ui/compositor/layer_animation_observer.h ('k') | ui/compositor/layer_animator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698