| Index: content/browser/renderer_host/media/video_capture_device_impl.cc
|
| diff --git a/content/browser/renderer_host/media/video_capture_device_impl.cc b/content/browser/renderer_host/media/video_capture_device_impl.cc
|
| index f2eac243fb8b6b07d6a9071b5f063981d5f826aa..045eda6092d0608c640ccf57bb4d4b9489356617 100644
|
| --- a/content/browser/renderer_host/media/video_capture_device_impl.cc
|
| +++ b/content/browser/renderer_host/media/video_capture_device_impl.cc
|
| @@ -34,10 +34,8 @@ namespace {
|
| void DeleteCaptureMachineOnUIThread(
|
| scoped_ptr<VideoCaptureMachine> capture_machine) {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| - if (capture_machine) {
|
| - capture_machine->Stop();
|
| - capture_machine.reset();
|
| - }
|
| +
|
| + capture_machine.reset();
|
| }
|
|
|
| } // namespace
|
| @@ -247,7 +245,8 @@ void VideoCaptureDeviceImpl::StopAndDeAllocate() {
|
| BrowserThread::PostTask(
|
| BrowserThread::UI, FROM_HERE, base::Bind(
|
| &VideoCaptureMachine::Stop,
|
| - base::Unretained(capture_machine_.get())));
|
| + base::Unretained(capture_machine_.get()),
|
| + base::Bind(&base::DoNothing)));
|
| }
|
|
|
| void VideoCaptureDeviceImpl::CaptureStarted(bool success) {
|
| @@ -267,9 +266,13 @@ VideoCaptureDeviceImpl::~VideoCaptureDeviceImpl() {
|
| // If capture_machine is not NULL, then we need to return to the UI thread to
|
| // safely stop the capture machine.
|
| if (capture_machine_) {
|
| + VideoCaptureMachine* capture_machine_ptr = capture_machine_.get();
|
| BrowserThread::PostTask(
|
| - BrowserThread::UI, FROM_HERE, base::Bind(
|
| - &DeleteCaptureMachineOnUIThread, base::Passed(&capture_machine_)));
|
| + BrowserThread::UI, FROM_HERE,
|
| + base::Bind(&VideoCaptureMachine::Stop,
|
| + base::Unretained(capture_machine_ptr),
|
| + base::Bind(&DeleteCaptureMachineOnUIThread,
|
| + base::Passed(&capture_machine_))));
|
| }
|
| DVLOG(1) << "VideoCaptureDeviceImpl@" << this << " destroying.";
|
| }
|
|
|