mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 20:05:38 +00:00
Fixed some memory leaks.
Original commit message from CVS: Fixed some memory leaks.
This commit is contained in:
parent
86f9a0ed31
commit
3091a399eb
3 changed files with 31 additions and 5 deletions
|
@ -1,3 +1,10 @@
|
|||
2006-04-13 Edgard Lima <edgard.lima@indt.org.br>
|
||||
|
||||
* sys/v4l2/gstv4l2src.c: (gst_v4l2element_class_init),
|
||||
(gst_v4l2src_dispose):
|
||||
* sys/v4l2/v4l2src_calls.c: (gst_v4l2src_buffer_new):
|
||||
Fixed some memory leaks.
|
||||
|
||||
2006-04-12 Edgard Lima <edgard.lima@indt.org.br>
|
||||
|
||||
* sys/v4l2/gstv4l2src.c: (gst_v4l2src_get_read):
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -789,15 +789,15 @@ gst_v4l2src_buffer_new (GstV4l2Src * v4l2src, guint size, guint8 * data,
|
|||
fps_d = 1;
|
||||
}
|
||||
|
||||
buf = (GstBuffer *) gst_mini_object_new (GST_TYPE_V4L2SRC_BUFFER);
|
||||
|
||||
GST_V4L2SRC_BUFFER (buf)->buf = srcbuf;
|
||||
|
||||
if (data == NULL) {
|
||||
GST_BUFFER_DATA (buf) = g_malloc (size);
|
||||
buf = gst_buffer_new_and_alloc (size);
|
||||
} else {
|
||||
buf = (GstBuffer *) gst_mini_object_new (GST_TYPE_V4L2SRC_BUFFER);
|
||||
GST_BUFFER_DATA (buf) = data;
|
||||
GST_V4L2SRC_BUFFER (buf)->buf = srcbuf;
|
||||
}
|
||||
|
||||
|
||||
GST_BUFFER_SIZE (buf) = size;
|
||||
|
||||
GST_BUFFER_TIMESTAMP (buf) =
|
||||
|
|
Loading…
Reference in a new issue