commit | 5b8dd4d75ec351e9326c24b42350015db63c3e7b | [log] [tgz] |
---|---|---|
author | Qingsi Wang <qingsi@google.com> | Wed Jun 20 20:30:43 2018 |
committer | Commit Bot <commit-bot@chromium.org> | Wed Jun 20 22:25:00 2018 |
tree | 567eed96687dbe6a2b81117ec607658c2364f04c | |
parent | b983bae92396ddd5c03212ada3c3f2b3606e3884 [diff] |
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}
diff --git a/p2p/base/p2ptransportchannel_unittest.cc b/p2p/base/p2ptransportchannel_unittest.cc index 89018ab..57af9dc 100644 --- a/p2p/base/p2ptransportchannel_unittest.cc +++ b/p2p/base/p2ptransportchannel_unittest.cc
@@ -394,6 +394,7 @@ return channel; } void DestroyChannels() { + main_.Clear(this); ep1_.cd1_.ch_.reset(); ep2_.cd1_.ch_.reset(); ep1_.cd2_.ch_.reset();