From 85e7a3989c70bb7c6c3c1e589aeda3b1907f73fb Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 24 Nov 2005 14:39:59 +0000 Subject: [PATCH] docs/manual/basics-helloworld.xml: Fix bug #315027: memory leak in example code in docs. Original commit message from CVS: * docs/manual/basics-helloworld.xml: Fix bug #315027: memory leak in example code in docs. --- ChangeLog | 5 +++++ docs/manual/basics-helloworld.xml | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 48e9ca35a2..56b86356b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-24 msmith,,, + + * docs/manual/basics-helloworld.xml: + Fix bug #315027: memory leak in example code in docs. + 2005-11-24 Michael Smith * gst/base/gstbasesink.c: (gst_base_sink_handle_object): diff --git a/docs/manual/basics-helloworld.xml b/docs/manual/basics-helloworld.xml index e6cadf16e8..9aaea7bafa 100644 --- a/docs/manual/basics-helloworld.xml +++ b/docs/manual/basics-helloworld.xml @@ -104,9 +104,14 @@ new_pad (GstElement *element, GstPad *pad, gpointer data) { + GstPad *sinkpad; /* We can now link this pad with the audio decoder */ g_print ("Dynamic pad created, linking parser/decoder\n"); - gst_pad_link (pad, gst_element_get_pad (decoder, "sink")); + + sinkpad = gst_element_get_pad (decoder, "sink")); + gst_pad_link (pad, sinkpad); + + gst_object_unref (sinkpad); } int