Fix a potential Chrome crash in audioproc.

There are Chrome crashes which appear to be occurring during some kind
of teardown. We might be able to avoid them by locking in the destructor.

On the other hand, this might have no impact, but at least isn't a bad
thing to do.

BUG=chromium:145341

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

git-svn-id: http://webrtc.googlecode.com/svn/trunk@2687 4adac7df-926f-26a2-2b94-8c16560cd09d
This commit is contained in:
andrew@webrtc.org 2012-08-29 16:58:25 +00:00
parent 4436fcebaf
commit 16cfbe2e89

View File

@ -100,6 +100,7 @@ AudioProcessingImpl::AudioProcessingImpl(int id)
}
AudioProcessingImpl::~AudioProcessingImpl() {
crit_->Enter();
while (!component_list_.empty()) {
ProcessingComponent* component = component_list_.front();
component->Destroy();
@ -113,9 +114,6 @@ AudioProcessingImpl::~AudioProcessingImpl() {
}
#endif
delete crit_;
crit_ = NULL;
if (render_audio_) {
delete render_audio_;
render_audio_ = NULL;
@ -125,6 +123,10 @@ AudioProcessingImpl::~AudioProcessingImpl() {
delete capture_audio_;
capture_audio_ = NULL;
}
crit_->Leave();
delete crit_;
crit_ = NULL;
}
CriticalSectionWrapper* AudioProcessingImpl::crit() const {