summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2023-10-25 18:30:38 +0200
committerMoonchild <moonchild@palemoon.org>2023-10-25 18:30:38 +0200
commitccb41c645cac3b3dd183c06099433143650c7431 (patch)
tree571036b7a5946773e36b1f8b9dbfe3d481636934
parent98c3aa57431c4b158c750dfabfd0ab90708ebf16 (diff)
downloaduxp-ccb41c645cac3b3dd183c06099433143650c7431.tar.gz
[WebRTC] Give ::Terminated() the same treatment as ::Close_g
-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
}