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

Unified Diff: ash/sticky_keys/sticky_keys_overlay.cc

Issue 1398403005: Prevent ~StickyKeysOverlay() from calling back into StickyKeysOverlay via the animator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/sticky_keys/sticky_keys_overlay.cc
diff --git a/ash/sticky_keys/sticky_keys_overlay.cc b/ash/sticky_keys/sticky_keys_overlay.cc
index 3826f7350027df4c23f7a5e510c500a2cd9663b7..6c376cfe9e76a0a8963f95b99c80f9abd67c1b89 100644
--- a/ash/sticky_keys/sticky_keys_overlay.cc
+++ b/ash/sticky_keys/sticky_keys_overlay.cc
@@ -231,7 +231,16 @@ StickyKeysOverlay::StickyKeysOverlay()
overlay_widget_->GetNativeView()->SetName("StickyKeysOverlay");
}
-StickyKeysOverlay::~StickyKeysOverlay() {}
+StickyKeysOverlay::~StickyKeysOverlay() {
+ // Remove ourself from the animator to avoid being re-entrantly called in
+ // |overlay_widget_|'s destructor.
+ ui::Layer* layer = overlay_widget_->GetLayer();
+ if (layer) {
+ ui::LayerAnimator* animator = layer->GetAnimator();
+ if (animator)
+ animator->RemoveObserver(this);
+ }
+}
void StickyKeysOverlay::Show(bool visible) {
if (is_visible_ == visible)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698