OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
601 // Need to detach RTP senders/receivers from WebRtcSession, | 601 // Need to detach RTP senders/receivers from WebRtcSession, |
602 // since it's about to be destroyed. | 602 // since it's about to be destroyed. |
603 for (const auto& sender : senders_) { | 603 for (const auto& sender : senders_) { |
604 sender->internal()->Stop(); | 604 sender->internal()->Stop(); |
605 } | 605 } |
606 for (const auto& receiver : receivers_) { | 606 for (const auto& receiver : receivers_) { |
607 receiver->internal()->Stop(); | 607 receiver->internal()->Stop(); |
608 } | 608 } |
609 // Destroy stats_ because it depends on session_. | 609 // Destroy stats_ because it depends on session_. |
610 stats_.reset(nullptr); | 610 stats_.reset(nullptr); |
611 if (stats_collector_) { | |
612 stats_collector_->WaitForPendingRequest(); | |
Taylor Brandstetter
2016/12/16 18:53:27
nit: I'd just put this in the RTCStatsCollector de
hbos
2016/12/19 09:52:48
It's not that you have to wait before destroying t
| |
613 stats_collector_ = nullptr; | |
614 } | |
611 // Now destroy session_ before destroying other members, | 615 // Now destroy session_ before destroying other members, |
612 // because its destruction fires signals (such as VoiceChannelDestroyed) | 616 // because its destruction fires signals (such as VoiceChannelDestroyed) |
613 // which will trigger some final actions in PeerConnection... | 617 // which will trigger some final actions in PeerConnection... |
614 session_.reset(nullptr); | 618 session_.reset(nullptr); |
615 // port_allocator_ lives on the network thread and should be destroyed there. | 619 // port_allocator_ lives on the network thread and should be destroyed there. |
616 network_thread()->Invoke<void>(RTC_FROM_HERE, | 620 network_thread()->Invoke<void>(RTC_FROM_HERE, |
617 [this] { port_allocator_.reset(nullptr); }); | 621 [this] { port_allocator_.reset(nullptr); }); |
618 } | 622 } |
619 | 623 |
620 bool PeerConnection::Initialize( | 624 bool PeerConnection::Initialize( |
(...skipping 1779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2400 | 2404 |
2401 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, | 2405 bool PeerConnection::StartRtcEventLog_w(rtc::PlatformFile file, |
2402 int64_t max_size_bytes) { | 2406 int64_t max_size_bytes) { |
2403 return event_log_->StartLogging(file, max_size_bytes); | 2407 return event_log_->StartLogging(file, max_size_bytes); |
2404 } | 2408 } |
2405 | 2409 |
2406 void PeerConnection::StopRtcEventLog_w() { | 2410 void PeerConnection::StopRtcEventLog_w() { |
2407 event_log_->StopLogging(); | 2411 event_log_->StopLogging(); |
2408 } | 2412 } |
2409 } // namespace webrtc | 2413 } // namespace webrtc |
OLD | NEW |