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..8540040c8936eae54ee7a2ae58dba58c6f4420ce 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* window_host = desktop_window_->GetHost(); |
+ // In the host destructor the compositor is destroyed before the window. |
+ if (window_host && window_host->compositor()) |
+ window_host->compositor()->RemoveObserver(this); |
desktop_window_->RemoveObserver(this); |
desktop_window_ = NULL; |
} |