| Index: content/browser/renderer_host/media/video_capture_manager.cc
|
| ===================================================================
|
| --- content/browser/renderer_host/media/video_capture_manager.cc (revision 109718)
|
| +++ content/browser/renderer_host/media/video_capture_manager.cc (working copy)
|
| @@ -4,6 +4,8 @@
|
|
|
| #include "content/browser/renderer_host/media/video_capture_manager.h"
|
|
|
| +#include <set>
|
| +
|
| #include "base/bind.h"
|
| #include "base/stl_util.h"
|
| #include "content/browser/renderer_host/media/video_capture_controller.h"
|
| @@ -51,12 +53,14 @@
|
| // Temporary solution: close all open devices and delete them, after the
|
| // thread is stopped.
|
| DLOG_IF(ERROR, !devices_.empty()) << "VideoCaptureManager: Open devices!";
|
| + std::set<media::VideoCaptureDevice*> devices_to_delete;
|
| for (VideoCaptureDevices::iterator it = devices_.begin();
|
| it != devices_.end();
|
| ++it) {
|
| it->second->DeAllocate();
|
| - delete it->second;
|
| + devices_to_delete.insert(it->second);
|
| }
|
| + STLDeleteElements(&devices_to_delete);
|
| STLDeleteValues(&controllers_);
|
| }
|
|
|
|
|