From d75fda4229c7f297f2aa15ae61520dbbb07160f2 Mon Sep 17 00:00:00 2001 From: Randell Jesup Date: Wed, 26 Mar 2014 17:58:25 -0400 Subject: [PATCH] Bug 986764: release all webrtc sub-modules before deleting engine r=gcp --- .../signaling/src/media-conduit/AudioConduit.cpp | 11 +++++++++++ .../signaling/src/media-conduit/VideoConduit.cpp | 11 ++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp b/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp index a755161afec1..3c4d8a9f1b4a 100644 --- a/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp +++ b/media/webrtc/signaling/src/media-conduit/AudioConduit.cpp @@ -112,6 +112,17 @@ WebrtcAudioConduit::~WebrtcAudioConduit() mOtherDirection->mShutDown = true; mVoiceEngine = nullptr; } else { + // We shouldn't delete the VoiceEngine until all these are released! + // And we can't use a Scoped ptr, since the order is arbitrary + mPtrVoENetwork = nullptr; + mPtrVoEBase = nullptr; + mPtrVoECodec = nullptr; + mPtrVoEXmedia = nullptr; + mPtrVoEProcessing = nullptr; + mPtrVoEVideoSync = nullptr; + mPtrVoERTP_RTCP = nullptr; + mPtrRTP = nullptr; + // only one opener can call Delete. Have it be the last to close. if(mVoiceEngine) { diff --git a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp index 4db89a855a2a..91a508848991 100644 --- a/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp +++ b/media/webrtc/signaling/src/media-conduit/VideoConduit.cpp @@ -116,7 +116,16 @@ WebrtcVideoConduit::~WebrtcVideoConduit() // let other side we terminated the channel mOtherDirection->mShutDown = true; mVideoEngine = nullptr; - } else { + } else { + // We can't delete the VideoEngine until all these are released! + // And we can't use a Scoped ptr, since the order is arbitrary + mPtrViEBase = nullptr; + mPtrViECapture = nullptr; + mPtrViECodec = nullptr; + mPtrViENetwork = nullptr; + mPtrViERender = nullptr; + mPtrRTP = nullptr; + // only one opener can call Delete. Have it be the last to close. if(mVideoEngine) {