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

Unified Diff: webrtc/test/vcm_capturer.cc

Issue 1465113002: Fix memory leak in vcm_capturer.cc. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 5 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/test/vcm_capturer.cc
diff --git a/webrtc/test/vcm_capturer.cc b/webrtc/test/vcm_capturer.cc
index 0a82236c9880487968c147938ecca7c8b83f26f9..b2f6f559178cb58041c10d4646b42feabb07f184 100644
--- a/webrtc/test/vcm_capturer.cc
+++ b/webrtc/test/vcm_capturer.cc
@@ -34,6 +34,8 @@ bool VcmCapturer::Init(size_t width, size_t height, size_t target_fps) {
}
vcm_ = webrtc::VideoCaptureFactory::Create(0, unique_name);
+ vcm_->AddRef();
pbos-webrtc 2015/11/26 17:12:12 Shouldn't this be done inside ::Create() maybe? Cr
+
vcm_->RegisterCaptureDataCallback(*this);
device_info->GetCapability(vcm_->CurrentDeviceName(), 0, capability_);
@@ -87,8 +89,6 @@ void VcmCapturer::Destroy() {
vcm_->DeRegisterCaptureDataCallback();
vcm_->Release();
- // TODO(pbos): How do I destroy the VideoCaptureModule? This still leaves
- // non-freed memory.
vcm_ = NULL;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698