summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--content/browser/renderer_host/media/video_capture_host.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/content/browser/renderer_host/media/video_capture_host.cc b/content/browser/renderer_host/media/video_capture_host.cc
index 4651f01..d6a6071 100644
--- a/content/browser/renderer_host/media/video_capture_host.cc
+++ b/content/browser/renderer_host/media/video_capture_host.cc
@@ -21,12 +21,18 @@ VideoCaptureHost::~VideoCaptureHost() {}
void VideoCaptureHost::OnChannelClosing() {
// Since the IPC channel is gone, close all requested VideoCaptureDevices.
- for (EntryMap::iterator it = entries_.begin(); it != entries_.end(); it++) {
+ for (EntryMap::iterator it = entries_.begin(); it != entries_.end(); ) {
const base::WeakPtr<VideoCaptureController>& controller = it->second;
if (controller) {
VideoCaptureControllerID controller_id(it->first);
media_stream_manager_->video_capture_manager()->StopCaptureForClient(
controller.get(), controller_id, this);
+ ++it;
+ } else {
+ // Remove the entry for this controller_id so that when the controller
+ // is added, the controller will be notified to stop for this client
+ // in DoControllerAddedOnIOThread.
+ entries_.erase(it++);
}
}
}