Call PrepareShutdown in the dtor just in case Close() hasn't been called

Bug: b/277912909
Change-Id: I0074de59f5d16d500795589a0c94ff4840ffe57a
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/302384
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Tomas Gunnarsson <tommi@webrtc.org>
Cr-Commit-Position: refs/heads/main@{#39932}
This commit is contained in:
Tommi 2023-04-24 11:31:45 +02:00 committed by WebRTC LUCI CQ
parent 70fc5a2e41
commit 94774d475b

View File

@ -543,6 +543,10 @@ PeerConnection::~PeerConnection() {
sdp_handler_->PrepareForShutdown();
}
// In case `Close()` wasn't called, always make sure the controller cancels
// potentially pending operations.
data_channel_controller_.PrepareForShutdown();
// Need to stop transceivers before destroying the stats collector because
// AudioRtpSender has a reference to the LegacyStatsCollector it will update
// when stopping.