Chromium Code Reviews| Index: ash/common/wm/screen_dimmer.cc |
| diff --git a/ash/common/wm/screen_dimmer.cc b/ash/common/wm/screen_dimmer.cc |
| index b00ac9052f783197bc776c92630e9d1383a19883..00e936ae2d2ab10bccb6153bd5ef413b6538c69b 100644 |
| --- a/ash/common/wm/screen_dimmer.cc |
| +++ b/ash/common/wm/screen_dimmer.cc |
| @@ -32,7 +32,9 @@ ScreenDimmer::ScreenDimmer(Container container) |
| } |
| ScreenDimmer::~ScreenDimmer() { |
| - WmShell::Get()->RemoveShellObserver(this); |
| + // Usage in chrome results in ScreenDimmer outliving the shell. |
| + if (WmShell::HasInstance()) |
|
James Cook
2016/09/20 23:26:18
Does this mean we'll never clean up this observer
sky
2016/09/20 23:33:05
That is correct. The ObserverList does not enforce
|
| + WmShell::Get()->RemoveShellObserver(this); |
| } |
| void ScreenDimmer::SetDimming(bool should_dim) { |