From d2b59b28e00c248cef2a672f339043585b448eee Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Sat, 2 Aug 2014 00:30:51 -0400 Subject: [PATCH] Bug 1047121: Release Window-capture VideoEngine when done; clean up shutdown code r=cpearce --- content/media/webrtc/MediaEngineWebRTC.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/content/media/webrtc/MediaEngineWebRTC.cpp b/content/media/webrtc/MediaEngineWebRTC.cpp index 1b1692bbeb7a..480602e2b1b6 100644 --- a/content/media/webrtc/MediaEngineWebRTC.cpp +++ b/content/media/webrtc/MediaEngineWebRTC.cpp @@ -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;