Bug 1047121: Release Window-capture VideoEngine when done; clean up shutdown code r=cpearce

This commit is contained in:
Randell Jesup 2014-08-02 00:30:51 -04:00
Родитель ebc2dd6406
Коммит d2b59b28e0
1 изменённых файлов: 10 добавлений и 2 удалений

Просмотреть файл

@ -381,24 +381,31 @@ MediaEngineWebRTC::Shutdown()
MutexAutoLock lock(mMutex);
// Clear callbacks before we go away since the engines may outlive us
mVideoSources.Clear();
mAudioSources.Clear();
if (mVideoEngine) {
mVideoSources.Clear();
mVideoEngine->SetTraceCallback(nullptr);
webrtc::VideoEngine::Delete(mVideoEngine);
}
if (mScreenEngine) {
mScreenEngine->SetTraceCallback(nullptr);
webrtc::VideoEngine::Delete(mScreenEngine);
}
if (mWinEngine) {
mWinEngine->SetTraceCallback(nullptr);
webrtc::VideoEngine::Delete(mWinEngine);
}
if (mBrowserEngine) {
mBrowserEngine->SetTraceCallback(nullptr);
webrtc::VideoEngine::Delete(mBrowserEngine);
}
if (mAppEngine) {
mAppEngine->SetTraceCallback(nullptr);
webrtc::VideoEngine::Delete(mAppEngine);
}
if (mVoiceEngine) {
mAudioSources.Clear();
mVoiceEngine->SetTraceCallback(nullptr);
webrtc::VoiceEngine::Delete(mVoiceEngine);
}
@ -406,6 +413,7 @@ MediaEngineWebRTC::Shutdown()
mVideoEngine = nullptr;
mVoiceEngine = nullptr;
mScreenEngine = nullptr;
mWinEngine = nullptr;
mBrowserEngine = nullptr;
mAppEngine = nullptr;