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

Unified Diff: content/browser/renderer_host/media/media_devices_dispatcher_host.cc

Issue 2606323002: Add null check for MediaDevicesManager in MDDH destructor. (Closed)
Patch Set: Add comment Created 3 years, 12 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 | content/browser/renderer_host/media/media_stream_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/renderer_host/media/media_devices_dispatcher_host.cc
diff --git a/content/browser/renderer_host/media/media_devices_dispatcher_host.cc b/content/browser/renderer_host/media/media_devices_dispatcher_host.cc
index d50e28a78e27a0f99215783ad6e34aad1ac3e0e1..c8e7b555c59225fc08c1b6476de5a9c208d847fa 100644
--- a/content/browser/renderer_host/media/media_devices_dispatcher_host.cc
+++ b/content/browser/renderer_host/media/media_devices_dispatcher_host.cc
@@ -95,6 +95,11 @@ MediaDevicesDispatcherHost::MediaDevicesDispatcherHost(
MediaDevicesDispatcherHost::~MediaDevicesDispatcherHost() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ // It may happen that media_devices_manager() is destroyed before MDDH on some
+ // shutdown scenarios.
+ if (!media_stream_manager_->media_devices_manager())
+ return;
+
for (size_t i = 0; i < NUM_MEDIA_DEVICE_TYPES; ++i) {
if (!device_change_subscriptions_[i].empty()) {
media_stream_manager_->media_devices_manager()
« no previous file with comments | « no previous file | content/browser/renderer_host/media/media_stream_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698