Fix a bug where TestAudioDeviceModule crashes if destroyed uninitialized.
Because thread_ object is created in Init, destructor used to crash when calling thread_->Stop() because it was referencing a null pointer. Bug: webrtc:9404 Change-Id: I1c943d0fa50f9341aaa516b32495bb25bf4d664b Reviewed-on: https://webrtc-review.googlesource.com/84122 Reviewed-by: Stefan Holmer <stefan@webrtc.org> Reviewed-by: Artem Titov <titovartem@webrtc.org> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23682}
This commit is contained in:
parent
aaa483bff6
commit
a97c931cba
@ -81,8 +81,10 @@ class TestAudioDeviceModuleImpl
|
|||||||
~TestAudioDeviceModuleImpl() {
|
~TestAudioDeviceModuleImpl() {
|
||||||
StopPlayout();
|
StopPlayout();
|
||||||
StopRecording();
|
StopRecording();
|
||||||
|
if (thread_) {
|
||||||
thread_->Stop();
|
thread_->Stop();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
int32_t Init() {
|
int32_t Init() {
|
||||||
RTC_CHECK(tick_->StartTimer(true, kFrameLengthMs / speed_));
|
RTC_CHECK(tick_->StartTimer(true, kFrameLengthMs / speed_));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user