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

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

Issue 7948004: Removing singelton property of MediaStreamManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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
Index: content/browser/renderer_host/media/video_capture_manager.cc
diff --git a/content/browser/renderer_host/media/video_capture_manager.cc b/content/browser/renderer_host/media/video_capture_manager.cc
index 0571b3f32bba32de91e352274bfbb54ae7acfd49..14d561ad3c102f81a9b2cf0dc7439ba9261fd1c5 100644
--- a/content/browser/renderer_host/media/video_capture_manager.cc
+++ b/content/browser/renderer_host/media/video_capture_manager.cc
@@ -25,8 +25,18 @@ VideoCaptureManager::VideoCaptureManager()
}
VideoCaptureManager::~VideoCaptureManager() {
- DCHECK(devices_.empty());
vc_device_thread_.Stop();
+ // TODO(mflodman) Remove this temporary solution when shut-down issue is
+ // resolved, i.e. all code below this comment.
+ // Temporary solution: close all open devices and delete them, after the
+ // thread is stopped.
+ DLOG_IF(ERROR, !devices_.empty()) << "VideoCaptureManager: Open devices!";
+ for (VideoCaptureDevices::iterator it = devices_.begin();
+ it != devices_.end();
+ ++it) {
+ it->second->DeAllocate();
+ delete it->second;
+ }
}
void VideoCaptureManager::Register(MediaStreamProviderListener* listener) {

Powered by Google App Engine
This is Rietveld 408576698