diff options
author | Edgard Lima <edgard.lima@indt.org.br> | 2006-04-13 21:45:57 +0000 |
---|---|---|
committer | Edgard Lima <edgard.lima@indt.org.br> | 2006-04-13 21:45:57 +0000 |
commit | 3091a399ebc5b2efad779d9cb82c2e4c9f013d26 (patch) | |
tree | 151b8dfc6e8eddad84238734ef880f5fc5fc8642 /sys/v4l2/gstv4l2src.c | |
parent | 86f9a0ed31021837b446812bf7778fb8a1835d5b (diff) | |
download | gst-plugins-bad-3091a399ebc5b2efad779d9cb82c2e4c9f013d26.tar.gz gst-plugins-bad-3091a399ebc5b2efad779d9cb82c2e4c9f013d26.tar.bz2 gst-plugins-bad-3091a399ebc5b2efad779d9cb82c2e4c9f013d26.zip |
Fixed some memory leaks.
Original commit message from CVS:
Fixed some memory leaks.
Diffstat (limited to 'sys/v4l2/gstv4l2src.c')
-rw-r--r-- | sys/v4l2/gstv4l2src.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/v4l2/gstv4l2src.c b/sys/v4l2/gstv4l2src.c index e2182990..35a68bad 100644 --- a/sys/v4l2/gstv4l2src.c +++ b/sys/v4l2/gstv4l2src.c @@ -102,6 +102,7 @@ static guint32 gst_v4l2_formats[] = { GST_BOILERPLATE (GstV4l2Src, gst_v4l2src, GstV4l2Element, GST_TYPE_V4L2ELEMENT); +static void gst_v4l2src_dispose (GObject * object); /* basesrc methods */ static gboolean gst_v4l2src_start (GstBaseSrc * src); @@ -162,6 +163,9 @@ gst_v4l2src_class_init (GstV4l2SrcClass * klass) basesrc_class->stop = gst_v4l2src_stop; pushsrc_class->create = gst_v4l2src_create; + + gobject_class->dispose = gst_v4l2src_dispose; + } static void @@ -183,6 +187,21 @@ gst_v4l2src_init (GstV4l2Src * v4l2src, GstV4l2SrcClass * klass) gst_base_src_set_live (GST_BASE_SRC (v4l2src), TRUE); } + +static void +gst_v4l2src_dispose (GObject * object) +{ + GstV4l2Src *v4l2src = GST_V4L2SRC (object); + + if (v4l2src->formats) { + gst_v4l2src_clear_format_list (v4l2src); + } + + if (((GObjectClass *) parent_class)->dispose) + ((GObjectClass *) parent_class)->dispose (object); +} + + static void gst_v4l2src_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) |