From: <jd...@fr...> - 2005-11-15 19:31:18
|
CVS Root: /cvs/gstreamer Module: gstreamer Changes by: jdahlin Date: Tue Nov 15 2005 11:31:17 PST Log message: * gst/base/gstbasesrc.c: (gst_base_src_init): * gst/elements/gsttypefindelement.c: (gst_type_find_element_init): * gst/gstqueue.c: (gst_queue_init): Free pad templates, fixes a couple of leaks. Modified files: . : ChangeLog gst : gstqueue.c gst/base : gstbasesrc.c gst/elements : gsttypefindelement.c Links: http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/ChangeLog.diff?r1=1.1890&r2=1.1891 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/gstqueue.c.diff?r1=1.159&r2=1.160 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/base/gstbasesrc.c.diff?r1=1.75&r2=1.76 http://freedesktop.org/cgi-bin/viewcvs.cgi/gstreamer/gstreamer/gst/elements/gsttypefindelement.c.diff?r1=1.50&r2=1.51 ====Begin Diffs==== Index: ChangeLog =================================================================== RCS file: /cvs/gstreamer/gstreamer/ChangeLog,v retrieving revision 1.1890 retrieving revision 1.1891 diff -u -d -r1.1890 -r1.1891 --- ChangeLog 15 Nov 2005 19:24:45 -0000 1.1890 +++ ChangeLog 15 Nov 2005 19:31:04 -0000 1.1891 @@ -1,3 +1,10 @@ +2005-11-15 Johan Dahlin <jo...@gn...> + + * gst/base/gstbasesrc.c: (gst_base_src_init): + * gst/elements/gsttypefindelement.c: (gst_type_find_element_init): + * gst/gstqueue.c: (gst_queue_init): + Free pad templates, fixes a couple of leaks. 2005-11-15 Daniel Fischer <dan at f3c dot com> Reviewed by: Tim-Philipp Müller <tim at centricular dot net> Index: gstqueue.c RCS file: /cvs/gstreamer/gstreamer/gst/gstqueue.c,v retrieving revision 1.159 retrieving revision 1.160 diff -u -d -r1.159 -r1.160 --- gstqueue.c 3 Nov 2005 12:16:49 -0000 1.159 +++ gstqueue.c 15 Nov 2005 19:31:04 -0000 1.160 @@ -331,9 +331,12 @@ static void gst_queue_init (GstQueue * queue) { - queue->sinkpad = - gst_pad_new_from_template (gst_static_pad_template_get (&sinktemplate), - "sink"); + GstPadTemplate *sink_template, *src_template; + sink_template = gst_static_pad_template_get (&sinktemplate); + queue->sinkpad = gst_pad_new_from_template (sink_template, "sink"); + g_object_unref (sink_template); gst_pad_set_chain_function (queue->sinkpad, GST_DEBUG_FUNCPTR (gst_queue_chain)); gst_pad_set_activatepush_function (queue->sinkpad, @@ -348,9 +351,10 @@ GST_DEBUG_FUNCPTR (gst_queue_bufferalloc)); gst_element_add_pad (GST_ELEMENT (queue), queue->sinkpad); - queue->srcpad = - gst_pad_new_from_template (gst_static_pad_template_get (&srctemplate), - "src"); + src_template = gst_static_pad_template_get (&srctemplate); + queue->srcpad = gst_pad_new_from_template (src_template, "src"); + g_object_unref (src_template); gst_pad_set_activatepush_function (queue->srcpad, GST_DEBUG_FUNCPTR (gst_queue_src_activate_push)); gst_pad_set_link_function (queue->srcpad, Index: gstbasesrc.c RCS file: /cvs/gstreamer/gstreamer/gst/base/gstbasesrc.c,v retrieving revision 1.75 retrieving revision 1.76 diff -u -d -r1.75 -r1.76 --- gstbasesrc.c 10 Nov 2005 14:45:27 -0000 1.75 +++ gstbasesrc.c 15 Nov 2005 19:31:04 -0000 1.76 @@ -195,6 +195,7 @@ GST_DEBUG_OBJECT (basesrc, "creating src pad"); pad = gst_pad_new_from_template (pad_template, "src"); + g_object_unref (pad_template); GST_DEBUG_OBJECT (basesrc, "setting functions on src pad"); gst_pad_set_activatepush_function (pad, Index: gsttypefindelement.c RCS file: /cvs/gstreamer/gstreamer/gst/elements/gsttypefindelement.c,v retrieving revision 1.50 retrieving revision 1.51 diff -u -d -r1.50 -r1.51 --- gsttypefindelement.c 9 Nov 2005 17:55:13 -0000 1.50 +++ gsttypefindelement.c 15 Nov 2005 19:31:05 -0000 1.51 @@ -204,10 +204,13 @@ gst_type_find_element_init (GstTypeFindElement * typefind, GstTypeFindElementClass * g_class) /* sinkpad */ - typefind->sink = - gst_pad_new_from_template (gst_static_pad_template_get - (&type_find_element_sink_template), "sink"); + src_template = gst_static_pad_template_get (&type_find_element_sink_template); + typefind->sink = gst_pad_new_from_template (src_template, "sink"); gst_pad_set_activate_function (typefind->sink, GST_DEBUG_FUNCPTR (gst_type_find_element_activate)); gst_pad_set_chain_function (typefind->sink, @@ -215,10 +218,12 @@ gst_pad_set_event_function (typefind->sink, GST_DEBUG_FUNCPTR (gst_type_find_element_handle_event)); gst_element_add_pad (GST_ELEMENT (typefind), typefind->sink); /* srcpad */ - typefind->src = - (&type_find_element_src_template), "src"); + sink_template = gst_static_pad_template_get (&type_find_element_src_template); + typefind->src = gst_pad_new_from_template (sink_template, "src"); gst_pad_set_activatepull_function (typefind->src, GST_DEBUG_FUNCPTR (gst_type_find_element_activate_src_pull)); gst_pad_set_checkgetrange_function (typefind->src, |