Fixes memory leaks introduced in 1698.
Review URL: https://webrtc-codereview.appspot.com/387014 git-svn-id: http://webrtc.googlecode.com/svn/trunk@1701 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
parent
57193f0f62
commit
d6d014ff12
@ -61,6 +61,7 @@ class RtcpFormatRembTest : public ::testing::Test {
|
|||||||
virtual void SetUp();
|
virtual void SetUp();
|
||||||
virtual void TearDown();
|
virtual void TearDown();
|
||||||
|
|
||||||
|
RtpRtcpClock* system_clock_;
|
||||||
ModuleRtpRtcpImpl* dummy_rtp_rtcp_impl_;
|
ModuleRtpRtcpImpl* dummy_rtp_rtcp_impl_;
|
||||||
RTCPSender* rtcp_sender_;
|
RTCPSender* rtcp_sender_;
|
||||||
RTCPReceiver* rtcp_receiver_;
|
RTCPReceiver* rtcp_receiver_;
|
||||||
@ -68,12 +69,10 @@ class RtcpFormatRembTest : public ::testing::Test {
|
|||||||
};
|
};
|
||||||
|
|
||||||
void RtcpFormatRembTest::SetUp() {
|
void RtcpFormatRembTest::SetUp() {
|
||||||
dummy_rtp_rtcp_impl_ =
|
system_clock_ = ModuleRTPUtility::GetSystemClock();
|
||||||
new ModuleRtpRtcpImpl(0, false, ModuleRTPUtility::GetSystemClock());
|
dummy_rtp_rtcp_impl_ = new ModuleRtpRtcpImpl(0, false, system_clock_);
|
||||||
rtcp_sender_ = new RTCPSender(0, false, ModuleRTPUtility::GetSystemClock(),
|
rtcp_sender_ = new RTCPSender(0, false, system_clock_, dummy_rtp_rtcp_impl_);
|
||||||
dummy_rtp_rtcp_impl_);
|
rtcp_receiver_ = new RTCPReceiver(0, system_clock_, dummy_rtp_rtcp_impl_);
|
||||||
rtcp_receiver_ = new RTCPReceiver(0, ModuleRTPUtility::GetSystemClock(),
|
|
||||||
dummy_rtp_rtcp_impl_);
|
|
||||||
test_transport_ = new TestTransport(rtcp_receiver_);
|
test_transport_ = new TestTransport(rtcp_receiver_);
|
||||||
|
|
||||||
EXPECT_EQ(0, rtcp_sender_->Init());
|
EXPECT_EQ(0, rtcp_sender_->Init());
|
||||||
@ -85,6 +84,7 @@ void RtcpFormatRembTest::TearDown() {
|
|||||||
delete rtcp_receiver_;
|
delete rtcp_receiver_;
|
||||||
delete dummy_rtp_rtcp_impl_;
|
delete dummy_rtp_rtcp_impl_;
|
||||||
delete test_transport_;
|
delete test_transport_;
|
||||||
|
delete system_clock_;
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(RtcpFormatRembTest, TestBasicAPI) {
|
TEST_F(RtcpFormatRembTest, TestBasicAPI) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2011 The WebRTC project authors. All Rights Reserved.
|
* Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
|
||||||
*
|
*
|
||||||
* Use of this source code is governed by a BSD-style license
|
* Use of this source code is governed by a BSD-style license
|
||||||
* that can be found in the LICENSE file in the root of the source
|
* that can be found in the LICENSE file in the root of the source
|
||||||
@ -92,12 +92,10 @@ class TestTransport : public Transport,
|
|||||||
class RtcpSenderTest : public ::testing::Test {
|
class RtcpSenderTest : public ::testing::Test {
|
||||||
protected:
|
protected:
|
||||||
RtcpSenderTest() {
|
RtcpSenderTest() {
|
||||||
rtp_rtcp_impl_ = new ModuleRtpRtcpImpl(0, false,
|
system_clock_ = ModuleRTPUtility::GetSystemClock();
|
||||||
ModuleRTPUtility::GetSystemClock());
|
rtp_rtcp_impl_ = new ModuleRtpRtcpImpl(0, false, system_clock_);
|
||||||
rtcp_sender_ = new RTCPSender(0, false, ModuleRTPUtility::GetSystemClock(),
|
rtcp_sender_ = new RTCPSender(0, false, system_clock_, rtp_rtcp_impl_);
|
||||||
rtp_rtcp_impl_);
|
rtcp_receiver_ = new RTCPReceiver(0, system_clock_, rtp_rtcp_impl_);
|
||||||
rtcp_receiver_ = new RTCPReceiver(0, ModuleRTPUtility::GetSystemClock(),
|
|
||||||
rtp_rtcp_impl_);
|
|
||||||
test_transport_ = new TestTransport(rtcp_receiver_);
|
test_transport_ = new TestTransport(rtcp_receiver_);
|
||||||
// Initialize
|
// Initialize
|
||||||
EXPECT_EQ(0, rtcp_sender_->Init());
|
EXPECT_EQ(0, rtcp_sender_->Init());
|
||||||
@ -109,8 +107,10 @@ class RtcpSenderTest : public ::testing::Test {
|
|||||||
delete rtcp_receiver_;
|
delete rtcp_receiver_;
|
||||||
delete rtp_rtcp_impl_;
|
delete rtp_rtcp_impl_;
|
||||||
delete test_transport_;
|
delete test_transport_;
|
||||||
|
delete system_clock_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
RtpRtcpClock* system_clock_;
|
||||||
ModuleRtpRtcpImpl* rtp_rtcp_impl_;
|
ModuleRtpRtcpImpl* rtp_rtcp_impl_;
|
||||||
RTCPSender* rtcp_sender_;
|
RTCPSender* rtcp_sender_;
|
||||||
RTCPReceiver* rtcp_receiver_;
|
RTCPReceiver* rtcp_receiver_;
|
||||||
|
Loading…
Reference in New Issue
Block a user