Chromium Code Reviews| Index: content/browser/media/capture/desktop_capture_device_aura.cc |
| diff --git a/content/browser/media/capture/desktop_capture_device_aura.cc b/content/browser/media/capture/desktop_capture_device_aura.cc |
| index 6b6557f1844058b74dc539b5d6b24289630dbaba..60713dc127b105a901b2f95896fb5dd43f4480a4 100644 |
| --- a/content/browser/media/capture/desktop_capture_device_aura.cc |
| +++ b/content/browser/media/capture/desktop_capture_device_aura.cc |
| @@ -235,8 +235,10 @@ void DesktopVideoCaptureMachine::Stop(const base::Closure& callback) { |
| // Stop observing compositor and window events. |
| if (desktop_window_) { |
| - if (desktop_window_->GetHost()) |
| - desktop_window_->GetHost()->compositor()->RemoveObserver(this); |
| + aura::WindowTreeHost* wth = desktop_window_->GetHost(); |
|
Sergey Ulanov
2014/12/12 18:46:53
Please use a more descriptive name.
From
http://go
|
| + // In the host destructor the compositor is destroyed before the window. |
| + if (wth && wth->compositor()) |
| + wth->compositor()->RemoveObserver(this); |
| desktop_window_->RemoveObserver(this); |
| desktop_window_ = NULL; |
| } |