Bug 1379392 - Avoid double-delete on failure to init VideoCapture module. r=mchiang
authorJan-Ivar Bruaroey <jib@mozilla.com>
Wed, 19 Jul 2017 16:14:47 -0400
changeset 418691 4eb7f7fbdd22f080309a9b95c38ed5bcd5e3fc3e
parent 418690 9ea7e992bf5224d216e9a2546b6dd7be70cbe419
child 418692 f0ed1ef5a791fdd7385e419b137c000d85fdd028
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmchiang
bugs1379392
milestone56.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1379392 - Avoid double-delete on failure to init VideoCapture module. r=mchiang MozReview-Commit-ID: I9p2NVzqc8
media/webrtc/trunk/webrtc/modules/video_capture/mac/video_capture_mac.mm
--- a/media/webrtc/trunk/webrtc/modules/video_capture/mac/video_capture_mac.mm
+++ b/media/webrtc/trunk/webrtc/modules/video_capture/mac/video_capture_mac.mm
@@ -96,17 +96,16 @@ rtc::scoped_refptr<VideoCaptureModule> V
                      deviceUniqueIdUTF8);
         return NULL;
     }
     if(newCaptureModule->Init(0, deviceUniqueIdUTF8) != 0)
     {
         WEBRTC_TRACE(webrtc::kTraceDebug, webrtc::kTraceVideoCapture, 0,
                      "could not Create for unique device %s, "
                      "newCaptureModule->Init()!=0", deviceUniqueIdUTF8);
-        delete newCaptureModule;
         return NULL;
     }
 
     // Successfully created VideoCaptureMacQuicktime. Return it
     WEBRTC_TRACE(webrtc::kTraceInfo, webrtc::kTraceVideoCapture, 0,
                  "Module created for unique device %s, will use AVFoundation "
                  "framework",deviceUniqueIdUTF8);
     return newCaptureModule;