Fix data races during VideoAdapterTest tear-down.

Explicitly disconnect the VideoCapturer to avoid frames being
delivered during listener destruction. This manifested only on DrMemory
Full on Windows which I was able to repro locally.

BUG=3671
R=henrike@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/15289004

git-svn-id: http://webrtc.googlecode.com/svn/trunk@6991 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
pbos@webrtc.org 2014-08-27 18:16:13 +00:00
parent 573a1eef3d
commit 75c3ec1763

View File

@ -69,6 +69,12 @@ class VideoAdapterTest : public testing::Test {
listener_.get(), &VideoCapturerListener::OnFrameCaptured); listener_.get(), &VideoCapturerListener::OnFrameCaptured);
} }
virtual void TearDown() {
// Explicitly disconnect the VideoCapturer before to avoid data races
// (frames delivered to VideoCapturerListener while it's being destructed).
capturer_->SignalFrameCaptured.disconnect_all();
}
protected: protected:
class VideoCapturerListener: public sigslot::has_slots<> { class VideoCapturerListener: public sigslot::has_slots<> {
public: public: