From 5b8dd4d75ec351e9326c24b42350015db63c3e7b Mon Sep 17 00:00:00 2001 From: Qingsi Wang Date: Wed, 20 Jun 2018 13:30:43 -0700 Subject: [PATCH] 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 Commit-Queue: Qingsi Wang Cr-Commit-Position: refs/heads/master@{#23691} --- p2p/base/p2ptransportchannel_unittest.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/p2p/base/p2ptransportchannel_unittest.cc b/p2p/base/p2ptransportchannel_unittest.cc index 89018ab3be..57af9dcb1b 100644 --- a/p2p/base/p2ptransportchannel_unittest.cc +++ b/p2p/base/p2ptransportchannel_unittest.cc @@ -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();