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

Unified Diff: media/capture/video/linux/v4l2_capture_delegate.cc

Issue 2815643002: Make V4L2CaptureDelegate non-ref-counted (Closed)
Patch Set: Created 3 years, 8 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: media/capture/video/linux/v4l2_capture_delegate.cc
diff --git a/media/capture/video/linux/v4l2_capture_delegate.cc b/media/capture/video/linux/v4l2_capture_delegate.cc
index 2f16c203996b82851c6181e67ac4a3f07b96c8a6..baa2e9f1f30f821fc8c9fd6c9bd8c7077ccf44f1 100644
--- a/media/capture/video/linux/v4l2_capture_delegate.cc
+++ b/media/capture/video/linux/v4l2_capture_delegate.cc
@@ -506,7 +506,8 @@ void V4L2CaptureDelegate::AllocateAndStart(
// Post task to start fetching frames from v4l2.
v4l2_task_runner_->PostTask(
- FROM_HERE, base::Bind(&V4L2CaptureDelegate::DoCapture, this));
+ FROM_HERE,
+ base::Bind(&V4L2CaptureDelegate::DoCapture, base::Unretained(this)));
mcasas 2017/04/11 17:17:34 How would you guarantee that |this| is alive when
Chandan 2017/04/11 19:46:43 Need to use weak pointer then? What do you suggest
}
void V4L2CaptureDelegate::StopAndDeAllocate() {
@@ -820,7 +821,8 @@ void V4L2CaptureDelegate::DoCapture() {
}
v4l2_task_runner_->PostTask(
- FROM_HERE, base::Bind(&V4L2CaptureDelegate::DoCapture, this));
+ FROM_HERE,
+ base::Bind(&V4L2CaptureDelegate::DoCapture, base::Unretained(this)));
}
void V4L2CaptureDelegate::SetErrorState(
« no previous file with comments | « media/capture/video/linux/v4l2_capture_delegate.h ('k') | media/capture/video/linux/v4l2_capture_delegate_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698