From ccb41c645cac3b3dd183c06099433143650c7431 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 25 Oct 2023 18:30:38 +0200 Subject: [WebRTC] Give ::Terminated() the same treatment as ::Close_g --- media/webrtc/signaling/src/media-conduit/WebrtcGmpVideoCodec.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 } -- cgit v1.2.3