Skip to content

Commit

Permalink
Merge r225459 - [GStreamer] GstPad leaked in WebKitTextCombiner
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=180314

Reviewed by Michael Catanzaro.

gst_element_get_static_pad() returns a full reference that si never freed, because gst_ghost_pad_new doesn't
take the ownership of the given pad.

* platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
(webkit_text_combiner_init):
  • Loading branch information
carlosgcampos committed Dec 19, 2017
1 parent f5f4a6f commit b3b5b10
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
13 changes: 13 additions & 0 deletions Source/WebCore/ChangeLog
@@ -1,3 +1,16 @@
2017-12-03 Carlos Garcia Campos <cgarcia@igalia.com>

[GStreamer] GstPad leaked in WebKitTextCombiner
https://bugs.webkit.org/show_bug.cgi?id=180314

Reviewed by Michael Catanzaro.

gst_element_get_static_pad() returns a full reference that si never freed, because gst_ghost_pad_new doesn't
take the ownership of the given pad.

* platform/graphics/gstreamer/TextCombinerGStreamer.cpp:
(webkit_text_combiner_init):

2017-12-03 Carlos Garcia Campos <cgarcia@igalia.com>

[GStreamer] GstCaps leaked in MediaPlayerPrivateGStreamer::createGSTPlayBin
Expand Down
Expand Up @@ -24,9 +24,11 @@
*/

#include "config.h"
#include "TextCombinerGStreamer.h"

#if ENABLE(VIDEO) && USE(GSTREAMER) && ENABLE(VIDEO_TRACK)

#include "TextCombinerGStreamer.h"
#include "GRefPtrGStreamer.h"

static GstStaticPadTemplate sinkTemplate =
GST_STATIC_PAD_TEMPLATE("sink_%u", GST_PAD_SINK, GST_PAD_REQUEST,
Expand Down Expand Up @@ -83,10 +85,10 @@ static void webkit_text_combiner_init(WebKitTextCombiner* combiner)
UNUSED_PARAM(ret);
ASSERT(ret);

GstPad* pad = gst_element_get_static_pad(combiner->funnel, "src");
GRefPtr<GstPad> pad = adoptGRef(gst_element_get_static_pad(combiner->funnel, "src"));
ASSERT(pad);

ret = gst_element_add_pad(GST_ELEMENT(combiner), gst_ghost_pad_new("src", pad));
ret = gst_element_add_pad(GST_ELEMENT(combiner), gst_ghost_pad_new("src", pad.get()));
ASSERT(ret);
}

Expand Down

0 comments on commit b3b5b10

Please sign in to comment.