Fix a dangling-pointer bug in P2PTransportChannel unit tests.

Messages posted to the main thread are handled by dangling pointers to
destroyed endpoints after the tests end.

Bug: None
Change-Id: I901d63bf11574882d0259cd4b07e628f6a4eebc5
Reviewed-on: https://webrtc-review.googlesource.com/84540
Reviewed-by: Taylor Brandstetter <deadbeef@webrtc.org>
Commit-Queue: Qingsi Wang <qingsi@google.com>
Cr-Commit-Position: refs/heads/master@{#23691}
This commit is contained in:
Qingsi Wang 2018-06-20 13:30:43 -07:00 committed by Commit Bot
parent b983bae923
commit 5b8dd4d75e

View File

@ -394,6 +394,7 @@ class P2PTransportChannelTestBase : public testing::Test,
return channel;
}
void DestroyChannels() {
main_.Clear(this);
ep1_.cd1_.ch_.reset();
ep2_.cd1_.ch_.reset();
ep1_.cd2_.ch_.reset();