Move video_sources_.clear() call to CallTest::DestroyStreams

When one of the sources is a FrameGeneratorCapturer, this implies that
its TaskQueue is stopped. Before this change, the FrameGeneratorCapturer
was destroyed later, by the CallTest destructor, which led to a
use-after-free race on the Clock object passed to the capturer.

Bug: webrtc:11018
Change-Id: I3e53f95a725b6fb53b13e182ecd2caf03ea15bc4
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/156170
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Reviewed-by: Yves Gerey <yvesg@google.com>
Reviewed-by: Ilya Nikolaevskiy <ilnik@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29443}
This commit is contained in:
Niels Möller
2019-10-10 12:42:41 +02:00
committed by Commit Bot
parent 7c3b10013c
commit 3b819f3d8b
2 changed files with 1 additions and 3 deletions

View File

@ -203,7 +203,6 @@ void CallTest::RunBaseTest(BaseTest* test) {
receive_transport_.reset();
frame_generator_capturer_ = nullptr;
video_sources_.clear();
DestroyCalls();
fake_send_audio_device_ = nullptr;
@ -666,6 +665,7 @@ void CallTest::DestroyStreams() {
receiver_call_->DestroyFlexfecReceiveStream(flexfec_recv_stream);
video_receive_streams_.clear();
video_sources_.clear();
}
void CallTest::DestroyVideoSendStreams() {

View File

@ -1342,7 +1342,6 @@ void VideoQualityTest::RunWithAnalyzer(const Params& params) {
if (graph_data_output_file)
fclose(graph_data_output_file);
video_sources_.clear();
send_transport.reset();
recv_transport.reset();
@ -1569,7 +1568,6 @@ void VideoQualityTest::RunWithRenderers(const Params& params) {
Stop();
DestroyStreams();
video_sources_.clear();
send_transport.reset();
recv_transport.reset();