Skip to content

Commit fbca3a6

Browse files
blinoaperezdc
authored andcommitted
[MSE][GStreamer] Fix releasing Stream and GstStream objects https://bugs.webkit.org/show_bug.cgi?id=266758 Reviewed by Philippe Normand. There was a circular reference between WebKitMediaSrcPadPrivate which owns a RefPtr<Stream>, and Stream which owns a GRefPtr<GstPad> const pad. * Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp: (webKitMediaSrcTearDownStream): Canonical link: https://commits.webkit.org/272605@main
1 parent 80ed64c commit fbca3a6

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Source/WebCore/platform/graphics/gstreamer/mse/WebKitMediaSourceGStreamer.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,11 @@ static void webKitMediaSrcTearDownStream(WebKitMediaSrc* source, const AtomStrin
347347
// Stop the thread now.
348348
gst_pad_set_active(stream->pad.get(), false);
349349

350-
if (source->priv->isStarted())
351-
gst_element_remove_pad(GST_ELEMENT(source), stream->pad.get());
350+
if (source->priv->isStarted()) {
351+
WebKitMediaSrcPad* pad = WEBKIT_MEDIA_SRC_PAD(stream->pad.get());
352+
gst_element_remove_pad(GST_ELEMENT(source), GST_PAD(pad));
353+
pad->priv->stream = nullptr;
354+
}
352355
source->priv->streams.remove(name);
353356
}
354357

0 commit comments

Comments
 (0)