summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
index 3b485372f2..b361ecac55 100644
--- a/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
+++ b/media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp
@@ -528,10 +528,16 @@ WebrtcGmpVideoEncoder::Terminated()
{
LOGD(("GMP Encoder Terminated: %p", (void *)this));
- mGMP->Close();
+ GMPVideoEncoderProxy* gmp(mGMP);
mGMP = nullptr;
mHost = nullptr;
mInitting = false;
+
+ if (gmp) {
+ // Do this last, since this could cause us to be destroyed
+ gmp->Close();
+ }
+
// Could now notify that it's dead
}